...
|
...
|
@@ -182,19 +182,26 @@ func RoleGroupDelete(param protocol.RequestRoleDelete) error { |
|
|
//GetRoleList 获取角色列表
|
|
|
func GetRoleList(adminid int64, companyId int64) ([]protocol.RoleGroup, error) {
|
|
|
var (
|
|
|
roleGroups = make([]protocol.RoleGroup, 0)
|
|
|
err error
|
|
|
groups []protocol.RoleInfo
|
|
|
// companyinfo *models.Company
|
|
|
roleGroups = make([]protocol.RoleGroup, 0)
|
|
|
err error
|
|
|
groups []protocol.RoleInfo
|
|
|
companyinfo *models.Company
|
|
|
)
|
|
|
// models.GetCompanyById(companyId)
|
|
|
companyinfo, err = models.GetCompanyById(companyId)
|
|
|
if err != nil {
|
|
|
log.Error("获取公司数据失败 GetCompanyById(%d) err:%s", companyId, err)
|
|
|
return roleGroups, protocol.NewErrWithMessage("1")
|
|
|
}
|
|
|
groups, err = getRoleGroupByCompany(companyId)
|
|
|
if err != nil {
|
|
|
log.Error("getRoleGroupByCompany err:%s", err)
|
|
|
return roleGroups, protocol.NewErrWithMessage("1")
|
|
|
}
|
|
|
|
|
|
for k, v := range groups {
|
|
|
if companyinfo.AdminId != adminid && v.IsDefault == models.ROLE_DEFAULR {
|
|
|
//非管理员过滤掉 管理员角色组
|
|
|
continue
|
|
|
}
|
|
|
var roles []protocol.RoleInfo
|
|
|
roles, err = getRoleInfoByPid(companyId, v.Id)
|
|
|
if err != nil {
|
...
|
...
|
|