+ GetRolesUserList

This commit is contained in:
gazebo
2019-09-11 11:04:29 +08:00
parent f1fbcf6366
commit 86fc32cf2e
2 changed files with 44 additions and 0 deletions

View File

@@ -380,6 +380,19 @@ func GetRoleUserList(ctx *jxcontext.Context, r *authz.RoleInfo) (userIDList []st
return api2.RoleMan.GetRoleUserList(r)
}
func GetRolesUserList(ctx *jxcontext.Context, rList []*authz.RoleInfo) (userIDMap map[string][]string, err error) {
userIDMap = make(map[string][]string)
for _, r := range rList {
userIDList, err2 := api2.RoleMan.GetRoleUserList(r)
if err = err2; err == nil {
userIDMap[r.GetFullName()] = userIDList
} else {
break
}
}
return userIDMap, err
}
func checkUserType(userID string, userType int8) (err error) {
userList, _, err := dao.GetUsers(dao.GetDB(), 0, "", []string{userID}, "", "", 0, 0)
if err != nil {