Skip to content

Commit

Permalink
fix: system privileges user cannot access system console
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiu Jian committed May 21, 2020
1 parent 9b37c10 commit 29283ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/apigateway/handler/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ func (this *projectRoles) add(roleId, roleName string) {

func (this *projectRoles) getToken(scope rbacutils.TRbacScope, user, userId, domain, domainId string, ip string) mcclient.TokenCredential {
return &mcclient.SSimpleToken{
Token: "faketoken",
Domain: domain,
DomainId: domainId,
User: user,
Expand Down Expand Up @@ -644,9 +645,9 @@ func (this *projectRoles) json(user, userId, domain, domainId string, ip string)
}
obj.Add(roles, "roles")
for _, scope := range []rbacutils.TRbacScope{
rbacutils.ScopeSystem,
rbacutils.ScopeDomain,
rbacutils.ScopeProject,
rbacutils.ScopeDomain,
rbacutils.ScopeSystem,
} {
token := this.getToken(scope, user, userId, domain, domainId, ip)
matches := policy.PolicyManager.MatchedPolicyNames(scope, token)
Expand Down

0 comments on commit 29283ff

Please sign in to comment.