- 重构authz结构
- 角色管理初版完成
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/dingding"
|
||||
"git.rosy.net.cn/jx-callback/business/authz"
|
||||
"git.rosy.net.cn/jx-callback/business/authz/autils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
@@ -205,7 +206,7 @@ func GetRoleUserList(ctx *jxcontext.Context, r *authz.RoleInfo) (userIDList []st
|
||||
func AddRoles4User(ctx *jxcontext.Context, userID string, rList []*authz.RoleInfo) (err error) {
|
||||
errList := errlist.New()
|
||||
for _, v := range rList {
|
||||
if err = authz.ValidateRole(v.Name, v.StoreID); err == nil {
|
||||
if err = autils.ValidateRole(v.Name, v.StoreID); err == nil {
|
||||
if err = api2.RoleMan.AddRole4User(userID, v); err != nil {
|
||||
errList.AddErr(err)
|
||||
}
|
||||
@@ -227,7 +228,7 @@ func DeleteRoles4User(ctx *jxcontext.Context, userID string, rList []*authz.Role
|
||||
}
|
||||
|
||||
func AddUsers4Role(ctx *jxcontext.Context, r *authz.RoleInfo, userIDList []string) (err error) {
|
||||
if err = authz.ValidateRole(r.Name, r.StoreID); err != nil {
|
||||
if err = autils.ValidateRole(r.Name, r.StoreID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user