...
|
...
|
@@ -55,18 +55,22 @@ func FilterRoleAll(adminid int64, companyid int64, list []protocol.RoleBase) []p |
|
|
log.Error(e.Error())
|
|
|
return newlist
|
|
|
}
|
|
|
if companyInfo.AdminId == adminid {
|
|
|
return list
|
|
|
}
|
|
|
for _, v := range list {
|
|
|
if v.IsDefault == models.ROLE_DEFAULR && v.Types == models.ROLETYPES_GROUP {
|
|
|
admingoroupId = v.Id
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
for k, v := range list {
|
|
|
if v.Id == admingoroupId || v.ParentId == admingoroupId {
|
|
|
if v.Types == models.ROLETYPES_ROLE && v.IsDefault == models.ROLE_DEFAULR {
|
|
|
continue
|
|
|
}
|
|
|
if companyInfo.AdminId != adminid {
|
|
|
//非主管理员
|
|
|
if v.Id == admingoroupId || v.ParentId == admingoroupId {
|
|
|
continue
|
|
|
}
|
|
|
}
|
|
|
|
|
|
newlist = append(newlist, list[k])
|
|
|
}
|
...
|
...
|
|