From ff3cd0fa1b7ceb3a4c81a236966977e0da5b894b Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 13 Aug 2019 16:40:40 +0800 Subject: [PATCH] =?UTF-8?q?-=20GetRoleUserList=E4=B8=AD=E5=BF=BD=E7=95=A5E?= =?UTF-8?q?RR=5FNAME=5FNOT=5FFOUND=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/authz/casbinauth/casbinauth.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/business/authz/casbinauth/casbinauth.go b/business/authz/casbinauth/casbinauth.go index 79e8e232a..59d04f2c6 100644 --- a/business/authz/casbinauth/casbinauth.go +++ b/business/authz/casbinauth/casbinauth.go @@ -3,8 +3,8 @@ package casbinauth import ( "git.rosy.net.cn/jx-callback/business/authz" "git.rosy.net.cn/jx-callback/business/authz/autils" - "git.rosy.net.cn/jx-callback/globals" "github.com/casbin/casbin" + "github.com/casbin/casbin/errors" ) type CasbinAuthz struct { @@ -36,8 +36,11 @@ func (c *CasbinAuthz) GetUserRoleList(userID string) (roleList []*authz.RoleInfo } func (c *CasbinAuthz) GetRoleUserList(r *authz.RoleInfo) (userIDList []string, err error) { - globals.SugarLogger.Debug(r.GetFullName()) + // globals.SugarLogger.Debug(roleFullName) userIDList, err = c.enforcer.GetUsersForRole(r.GetFullName()) + if err == errors.ERR_NAME_NOT_FOUND { + err = nil + } return userIDList, err }