mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
parent
44f5db5609
commit
702fc3477d
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user