- auth1与auth2以为是兼容
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"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"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jsonerr"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
@@ -229,6 +230,8 @@ func AddRoles4User(ctx *jxcontext.Context, userID string, rList []*authz.RoleInf
|
||||
if err = autils.ValidateRole(v.Name, v.StoreID); err == nil {
|
||||
if err = api2.RoleMan.AddRole4User(userID, v); err != nil {
|
||||
errList.AddErr(err)
|
||||
} else if v.StoreID > 0 {
|
||||
jxutils.HandleUserWXRemark(dao.GetDB(), userID, true)
|
||||
}
|
||||
} else {
|
||||
errList.AddErr(err)
|
||||
@@ -242,6 +245,8 @@ func DeleteRoles4User(ctx *jxcontext.Context, userID string, rList []*authz.Role
|
||||
for _, v := range rList {
|
||||
if err = api2.RoleMan.DeleteRole4User(userID, v); err != nil {
|
||||
errList.AddErr(err)
|
||||
} else if v.StoreID > 0 {
|
||||
jxutils.HandleUserWXRemark(dao.GetDB(), userID, true)
|
||||
}
|
||||
}
|
||||
return errList.GetErrListAsOne()
|
||||
@@ -259,6 +264,8 @@ func AddUsers4Role(ctx *jxcontext.Context, r *authz.RoleInfo, userIDList []strin
|
||||
}
|
||||
if err = api2.RoleMan.AddRole4User(v, r); err != nil {
|
||||
errList.AddErr(err)
|
||||
} else if r.StoreID > 0 {
|
||||
jxutils.HandleUserWXRemark(dao.GetDB(), v, true)
|
||||
}
|
||||
}
|
||||
return errList.GetErrListAsOne()
|
||||
@@ -269,6 +276,8 @@ func DeleteUsers4Role(ctx *jxcontext.Context, r *authz.RoleInfo, userIDList []st
|
||||
for _, v := range userIDList {
|
||||
if err = api2.RoleMan.DeleteRole4User(v, r); err != nil {
|
||||
errList.AddErr(err)
|
||||
} else if r.StoreID > 0 {
|
||||
jxutils.HandleUserWXRemark(dao.GetDB(), v, true)
|
||||
}
|
||||
}
|
||||
return errList.GetErrListAsOne()
|
||||
|
||||
Reference in New Issue
Block a user