From 1e35df5550092b3df2260194b51e9f1ee61e5f0f Mon Sep 17 00:00:00 2001 From: Eric Leijonmarck Date: Fri, 19 Apr 2024 09:08:50 +0100 Subject: [PATCH] Apply suggestions from code review remove unnecessary comments Co-authored-by: Ieva --- .../accesscontrol/resourcepermissions/store.go | 12 +----------- .../accesscontrol/resourcepermissions/store_test.go | 1 - 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/pkg/services/accesscontrol/resourcepermissions/store.go b/pkg/services/accesscontrol/resourcepermissions/store.go index a2807314e06..f9fc903ae14 100644 --- a/pkg/services/accesscontrol/resourcepermissions/store.go +++ b/pkg/services/accesscontrol/resourcepermissions/store.go @@ -723,17 +723,8 @@ func managedPermission(action, resource string, resourceID, resourceAttribute st ACTION SETS Stores actionsets IN MEMORY */ -// - To grant access to users/teams/basic roles during runtime, users will go through the managed permissions view and access-control will be enforced based on their permissions. // ActionSet is a struct that represents a set of actions that can be performed on a resource. -// An example of an action set is "folders:edit" which represents the actions that can be performed on a datasource with the uid of 1. -/* -```go -actionSet := &ActionSet{ - Resource: "folders", - Permission: "edit", - Actions: []string{"folders:read", "folders:write", "dashboards:read", "dashboards:write"}, -}` -*/ +// An example of an action set is "folders:edit" which represents the set of RBAC actions that are granted by edit access to a folder. type ActionSetService interface { GetActionSet(actionName string) []string @@ -773,7 +764,6 @@ func (s *InMemoryActionSets) StoreActionSet(resource, permission string, actions s.log.Debug("storing action set\n") name := s.GetActionSetName(resource, permission) actionSet := &ActionSet{ - // folders:edit Action: name, Actions: actions, } diff --git a/pkg/services/accesscontrol/resourcepermissions/store_test.go b/pkg/services/accesscontrol/resourcepermissions/store_test.go index d205f550b05..5774e74adad 100644 --- a/pkg/services/accesscontrol/resourcepermissions/store_test.go +++ b/pkg/services/accesscontrol/resourcepermissions/store_test.go @@ -755,7 +755,6 @@ func retrievePermissionsHelper(store *store, t *testing.T) []orgPermission { return permissions } -// TODO: Fix this test func TestStore_ResourcePermissionsActionSets(t *testing.T) { if testing.Short() { t.Skip("skipping integration test")