@ -107,24 +107,46 @@ func GetUserPower(appType string, postId int64, roleList []string) (menuPoint, o
}
//获取角色权限
if len ( roleList ) > 0 {
for _ , v := range roleList {
var roleEmpower modelssystempermission . RoleEmpower
err = roleEmpower . GetCont ( map [ string ] interface { } { "`role_id`" : v , "`system`" : appType } )
if err == nil {
if roleEmpower . PointId != "" {
pointIdList := strings . Split ( roleEmpower . PointId , "," )
menuPoint = publicmethod . MergeStruct [ string ] ( pointIdList , menuPoint )
}
if roleEmpower . Operation != "" {
operationIdList := strings . Split ( roleEmpower . Operation , "," )
opeart = publicmethod . MergeStruct [ string ] ( operationIdList , opeart )
}
if roleEmpower . Organization != "" {
orgIdList := strings . Split ( roleEmpower . Organization , "," )
orgList = publicmethod . MergeStruct [ string ] ( orgIdList , orgList )
var roleId [ ] int64
err = overall . CONSTANT_DB_System_Permission . Model ( & modelssystempermission . SystemRole { } ) . Select ( "`id`" ) . Where ( "`state` = 1 AND `id` IN ?" , roleList ) . Find ( & roleId ) . Error
if err == nil && len ( roleId ) > 0 {
for _ , v := range roleId {
var roleEmpower modelssystempermission . RoleEmpower
err = roleEmpower . GetCont ( map [ string ] interface { } { "`role_id`" : v , "`system`" : appType } )
if err == nil {
if roleEmpower . PointId != "" {
pointIdList := strings . Split ( roleEmpower . PointId , "," )
menuPoint = publicmethod . MergeStruct [ string ] ( pointIdList , menuPoint )
}
if roleEmpower . Operation != "" {
operationIdList := strings . Split ( roleEmpower . Operation , "," )
opeart = publicmethod . MergeStruct [ string ] ( operationIdList , opeart )
}
if roleEmpower . Organization != "" {
orgIdList := strings . Split ( roleEmpower . Organization , "," )
orgList = publicmethod . MergeStruct [ string ] ( orgIdList , orgList )
}
}
}
}
// for _, v := range roleList {
// var roleEmpower modelssystempermission.RoleEmpower
// err = roleEmpower.GetCont(map[string]interface{}{"`role_id`": v, "`system`": appType})
// if err == nil {
// if roleEmpower.PointId != "" {
// pointIdList := strings.Split(roleEmpower.PointId, ",")
// menuPoint = publicmethod.MergeStruct[string](pointIdList, menuPoint)
// }
// if roleEmpower.Operation != "" {
// operationIdList := strings.Split(roleEmpower.Operation, ",")
// opeart = publicmethod.MergeStruct[string](operationIdList, opeart)
// }
// if roleEmpower.Organization != "" {
// orgIdList := strings.Split(roleEmpower.Organization, ",")
// orgList = publicmethod.MergeStruct[string](orgIdList, orgList)
// }
// }
// }
}
return