RBAC: Fix folder move check when action sets are disabled (#91200)
fox folder move check when action sets are disabled
This commit is contained in:
@@ -978,6 +978,12 @@ func (s *Service) canMove(ctx context.Context, cmd *folder.MoveFolderCommand) (b
|
||||
var evaluators []accesscontrol.Evaluator
|
||||
currentFolderScope := dashboards.ScopeFoldersProvider.GetResourceScopeUID(cmd.UID)
|
||||
for action, scopes := range permissions {
|
||||
// Skip unexpanded action sets - they have no impact if action sets are not enabled
|
||||
if !s.features.IsEnabled(ctx, featuremgmt.FlagAccessActionSets) {
|
||||
if action == "folders:view" || action == "folders:edit" || action == "folders:admin" {
|
||||
continue
|
||||
}
|
||||
}
|
||||
for _, scope := range newFolderAndParentUIDs {
|
||||
if slices.Contains(scopes, scope) {
|
||||
evaluators = append(evaluators, accesscontrol.EvalPermission(action, currentFolderScope))
|
||||
|
||||
Reference in New Issue
Block a user