diff --git a/pkg/cloudcommon/db/rbac.go b/pkg/cloudcommon/db/rbac.go index fb112db42d..f19ce67698 100644 --- a/pkg/cloudcommon/db/rbac.go +++ b/pkg/cloudcommon/db/rbac.go @@ -42,7 +42,7 @@ func isJointListRbacAllowed(manager IJointModelManager, userCred mcclient.TokenC return isListRbacAllowedInternal(manager.GetMasterManager(), manager.KeywordPlural(), userCred, isAdminMode) } -func isClassActionRbacAllowed(manager IModelManager, userCred mcclient.TokenCredential, ownerProjId string, action string, extra...string) bool { +func isClassActionRbacAllowed(manager IModelManager, userCred mcclient.TokenCredential, ownerProjId string, action string, extra ...string) bool { var requireAdmin bool ownerId := manager.GetOwnerId(userCred) if len(ownerId) > 0 { diff --git a/pkg/util/rbacutils/rabc_test.go b/pkg/util/rbacutils/rabc_test.go index 765127dc74..56aeca8736 100644 --- a/pkg/util/rbacutils/rabc_test.go +++ b/pkg/util/rbacutils/rabc_test.go @@ -283,10 +283,10 @@ func TestSRabcPolicy_Explain(t *testing.T) { func TestTRbacResult_IsHigherPrivilege(t *testing.T) { cases := []struct { - t1 TRbacResult - t2 TRbacResult + t1 TRbacResult + t2 TRbacResult want bool - } { + }{ {Allow, Allow, false}, {Allow, OwnerAllow, true}, {Deny, Deny, false}, @@ -301,4 +301,4 @@ func TestTRbacResult_IsHigherPrivilege(t *testing.T) { t.Errorf("%s IsHigherPrivilege %s want %v got %v", c.t1, c.t2, c.want, got) } } -} \ No newline at end of file +}