作者 唐旭辉

数据输出调整

... ... @@ -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])
}
... ...
... ... @@ -140,7 +140,7 @@ func RoleEdit(param protocol.RequestRoleEdit) (*protocol.ResponseRoleInfo, error
var oldParent *models.Role
oldParent, err = models.GetRoleById(param.Pid)
if err != nil {
log.Error("获取父级数据失败;%s", err)
log.Error("获取父级数据失败;%s", err)
return nil, protocol.NewErrWithMessage("1")
}
if yes := oldParent.IsDefaultRole(); yes {
... ...