正在显示
5 个修改的文件
包含
36 行增加
和
36 行删除
@@ -68,8 +68,8 @@ func (c *CommonController) SelectorRole() { | @@ -68,8 +68,8 @@ func (c *CommonController) SelectorRole() { | ||
68 | switch param.For { | 68 | switch param.For { |
69 | case "user": | 69 | case "user": |
70 | //编辑用户时 | 70 | //编辑用户时 |
71 | - list := servecommon.SelectorRoleAll(companyid) | ||
72 | - roles = servecommon.FilterRoleAll(userid, companyid, list) | 71 | + roles = servecommon.SelectorRoleAll(companyid) |
72 | + //roles = servecommon.FilterRoleAll(userid, companyid, list) | ||
73 | case "role": | 73 | case "role": |
74 | //编辑角色时 | 74 | //编辑角色时 |
75 | list := servecommon.SelectorRoleAll(companyid) | 75 | list := servecommon.SelectorRoleAll(companyid) |
@@ -84,7 +84,7 @@ type ResponseUserHasMenu struct { | @@ -84,7 +84,7 @@ type ResponseUserHasMenu struct { | ||
84 | SeniorStatus int8 `json:"senior_status" orm:"column(senior_status)"` | 84 | SeniorStatus int8 `json:"senior_status" orm:"column(senior_status)"` |
85 | Code string `json:"code" orm:"column(code)"` | 85 | Code string `json:"code" orm:"column(code)"` |
86 | Sort int `json:"sort" orm:"column(sort)"` | 86 | Sort int `json:"sort" orm:"column(sort)"` |
87 | - Status int `json:"status" orm:"column(status)"` | 87 | + Status int `json:"status" orm:"-"` |
88 | } | 88 | } |
89 | 89 | ||
90 | func (c *ResponseUserHasMenu) StatusYes() { | 90 | func (c *ResponseUserHasMenu) StatusYes() { |
@@ -345,7 +345,7 @@ func GetUserHasMenu(userid, companyid int64) ([]protocol.ResponseUserHasMenu, er | @@ -345,7 +345,7 @@ func GetUserHasMenu(userid, companyid int64) ([]protocol.ResponseUserHasMenu, er | ||
345 | FROM role_menu AS a | 345 | FROM role_menu AS a |
346 | JOIN user_role AS b ON a.role_id = b.role_id | 346 | JOIN user_role AS b ON a.role_id = b.role_id |
347 | JOIN role AS c ON a.role_id = c.id | 347 | JOIN role AS c ON a.role_id = c.id |
348 | - WHERE b.user_company_id=? AND c.delete_at =0 ` | 348 | + WHERE b.user_company_id=? AND c.delete_at =0 AND b.enable_status=1 ` |
349 | var menuids []int64 | 349 | var menuids []int64 |
350 | err = utils.ExecuteQueryAll(&menuids, datasql2, ucompany.Id) | 350 | err = utils.ExecuteQueryAll(&menuids, datasql2, ucompany.Id) |
351 | if err != nil { | 351 | if err != nil { |
@@ -44,38 +44,38 @@ func SelectorRoleAll(companyid int64) []protocol.RoleBase { | @@ -44,38 +44,38 @@ func SelectorRoleAll(companyid int64) []protocol.RoleBase { | ||
44 | return roles | 44 | return roles |
45 | } | 45 | } |
46 | 46 | ||
47 | -func FilterRoleAll(adminid int64, companyid int64, list []protocol.RoleBase) []protocol.RoleBase { | ||
48 | - var ( | ||
49 | - newlist []protocol.RoleBase | ||
50 | - admingoroupId int64 | ||
51 | - ) | ||
52 | - companyInfo, err := models.GetCompanyById(companyid) | ||
53 | - if err != nil { | ||
54 | - e := fmt.Errorf("GetCompanyById(%d) err:%s", companyid, err) | ||
55 | - log.Error(e.Error()) | ||
56 | - return newlist | ||
57 | - } | ||
58 | - for _, v := range list { | ||
59 | - if v.IsDefault == models.ROLE_DEFAULR && v.Types == models.ROLETYPES_GROUP { | ||
60 | - admingoroupId = v.Id | ||
61 | - break | ||
62 | - } | ||
63 | - } | ||
64 | - for k, v := range list { | ||
65 | - // if v.Types == models.ROLETYPES_ROLE && v.IsDefault == models.ROLE_DEFAULR { | ||
66 | - // continue | ||
67 | - // } | ||
68 | - if companyInfo.AdminId != adminid { | ||
69 | - //非主管理员 | ||
70 | - if v.Id == admingoroupId || v.ParentId == admingoroupId { | ||
71 | - continue | ||
72 | - } | ||
73 | - } | 47 | +// func FilterRoleAll(adminid int64, companyid int64, list []protocol.RoleBase) []protocol.RoleBase { |
48 | +// var ( | ||
49 | +// newlist []protocol.RoleBase | ||
50 | +// admingoroupId int64 | ||
51 | +// ) | ||
52 | +// companyInfo, err := models.GetCompanyById(companyid) | ||
53 | +// if err != nil { | ||
54 | +// e := fmt.Errorf("GetCompanyById(%d) err:%s", companyid, err) | ||
55 | +// log.Error(e.Error()) | ||
56 | +// return newlist | ||
57 | +// } | ||
58 | +// for _, v := range list { | ||
59 | +// if v.IsDefault == models.ROLE_DEFAULR && v.Types == models.ROLETYPES_GROUP { | ||
60 | +// admingoroupId = v.Id | ||
61 | +// break | ||
62 | +// } | ||
63 | +// } | ||
64 | +// for k, v := range list { | ||
65 | +// // if v.Types == models.ROLETYPES_ROLE && v.IsDefault == models.ROLE_DEFAULR { | ||
66 | +// // continue | ||
67 | +// // } | ||
68 | +// if companyInfo.AdminId != adminid { | ||
69 | +// //非主管理员 | ||
70 | +// if v.Id == admingoroupId || v.ParentId == admingoroupId { | ||
71 | +// continue | ||
72 | +// } | ||
73 | +// } | ||
74 | 74 | ||
75 | - newlist = append(newlist, list[k]) | ||
76 | - } | ||
77 | - return newlist | ||
78 | -} | 75 | +// newlist = append(newlist, list[k]) |
76 | +// } | ||
77 | +// return newlist | ||
78 | +// } | ||
79 | 79 | ||
80 | func FilterRoleGroup(adminid int64, companyid int64, list []protocol.RoleBase) []protocol.RoleBase { | 80 | func FilterRoleGroup(adminid int64, companyid int64, list []protocol.RoleBase) []protocol.RoleBase { |
81 | var ( | 81 | var ( |
-
请 注册 或 登录 后发表评论