diff --git a/pkg/cloudcommon/db/db_dispatcher.go b/pkg/cloudcommon/db/db_dispatcher.go index 41671468af..c2d72e15f2 100644 --- a/pkg/cloudcommon/db/db_dispatcher.go +++ b/pkg/cloudcommon/db/db_dispatcher.go @@ -66,7 +66,7 @@ func (dispatcher *DBModelDispatcher) Filter(f appsrv.FilterHandler) appsrv.Filte func fetchUserCredential(ctx context.Context) mcclient.TokenCredential { token := auth.FetchUserCredential(ctx) - if token == nil && ! consts.IsRbacEnabled() { + if token == nil && !consts.IsRbacEnabled() { log.Fatalf("user token credential not found?") } return token diff --git a/pkg/cloudcommon/policy/policy.go b/pkg/cloudcommon/policy/policy.go index 489ffbbbbe..7517dfa087 100644 --- a/pkg/cloudcommon/policy/policy.go +++ b/pkg/cloudcommon/policy/policy.go @@ -257,7 +257,7 @@ func (manager *SPolicyManager) ExplainRpc(userCred mcclient.TokenCredential, par } func (manager *SPolicyManager) IsAdminCapable(userCred mcclient.TokenCredential) bool { - if ! consts.IsRbacEnabled() && userCred.IsSystemAdmin() { + if !consts.IsRbacEnabled() && userCred.IsSystemAdmin() { return true } diff --git a/pkg/util/rbacutils/rabc.go b/pkg/util/rbacutils/rabc.go index aedb7716a5..47c8ff6d69 100644 --- a/pkg/util/rbacutils/rabc.go +++ b/pkg/util/rbacutils/rabc.go @@ -150,7 +150,7 @@ func (policy *SRbacPolicy) GetMatchRule(service string, resource string, action match, matchCnt, weight := policy.Rules[i].match(service, resource, action, extra...) if match && (maxMatchCnt < matchCnt || (maxMatchCnt == matchCnt && minWeight > weight) || - (maxMatchCnt == matchCnt && minWeight == weight && matchRule.stricterThan(&policy.Rules[i]))) { + (maxMatchCnt == matchCnt && minWeight == weight && matchRule.stricterThan(&policy.Rules[i]))) { maxMatchCnt = matchCnt minWeight = weight matchRule = &policy.Rules[i]