正在显示
1 个修改的文件
包含
13 行增加
和
6 行删除
@@ -182,19 +182,26 @@ func RoleGroupDelete(param protocol.RequestRoleDelete) error { | @@ -182,19 +182,26 @@ func RoleGroupDelete(param protocol.RequestRoleDelete) error { | ||
182 | //GetRoleList 获取角色列表 | 182 | //GetRoleList 获取角色列表 |
183 | func GetRoleList(adminid int64, companyId int64) ([]protocol.RoleGroup, error) { | 183 | func GetRoleList(adminid int64, companyId int64) ([]protocol.RoleGroup, error) { |
184 | var ( | 184 | var ( |
185 | - roleGroups = make([]protocol.RoleGroup, 0) | ||
186 | - err error | ||
187 | - groups []protocol.RoleInfo | ||
188 | - // companyinfo *models.Company | 185 | + roleGroups = make([]protocol.RoleGroup, 0) |
186 | + err error | ||
187 | + groups []protocol.RoleInfo | ||
188 | + companyinfo *models.Company | ||
189 | ) | 189 | ) |
190 | - // models.GetCompanyById(companyId) | 190 | + companyinfo, err = models.GetCompanyById(companyId) |
191 | + if err != nil { | ||
192 | + log.Error("获取公司数据失败 GetCompanyById(%d) err:%s", companyId, err) | ||
193 | + return roleGroups, protocol.NewErrWithMessage("1") | ||
194 | + } | ||
191 | groups, err = getRoleGroupByCompany(companyId) | 195 | groups, err = getRoleGroupByCompany(companyId) |
192 | if err != nil { | 196 | if err != nil { |
193 | log.Error("getRoleGroupByCompany err:%s", err) | 197 | log.Error("getRoleGroupByCompany err:%s", err) |
194 | return roleGroups, protocol.NewErrWithMessage("1") | 198 | return roleGroups, protocol.NewErrWithMessage("1") |
195 | } | 199 | } |
196 | - | ||
197 | for k, v := range groups { | 200 | for k, v := range groups { |
201 | + if companyinfo.AdminId != adminid && v.IsDefault == models.ROLE_DEFAULR { | ||
202 | + //非管理员过滤掉 管理员角色组 | ||
203 | + continue | ||
204 | + } | ||
198 | var roles []protocol.RoleInfo | 205 | var roles []protocol.RoleInfo |
199 | roles, err = getRoleInfoByPid(companyId, v.Id) | 206 | roles, err = getRoleInfoByPid(companyId, v.Id) |
200 | if err != nil { | 207 | if err != nil { |
-
请 注册 或 登录 后发表评论