diff --git a/auth/auth.go b/auth/auth.go index 533d806..f6b526b 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -109,12 +109,6 @@ func (f *authFactory) New(scope string) Auth { policies: make(map[string][][2]string), roleInitDone: make(map[string]bool), } - // 设置权限域信息 - auth.roleDefs["_scope_info"] = roleDefinition{ - code: "_scope_info", - name: scope, - description: scope + " scope", - } f.apps[scope] = auth return auth } @@ -175,9 +169,6 @@ func (a *appAuth) AddRole(roleCode, roleName string, policies ...string) error { if roleCode == "" || roleName == "" { return fmt.Errorf("role code and name cannot be empty") } - if roleCode == "_scope_info" { - return fmt.Errorf("reserved role code: _scope_info") - } // 解析并验证权限格式 parsedPolicies := make([][2]string, 0, len(policies))