RBAC: Return the underlying error instead of internal server or bad request for managed permission endpoints (#80974)

* return not found instead of an internal server error when listing/updating permissions

* openapi gen
This commit is contained in:
Ieva
2024-01-25 16:24:52 +00:00
committed by GitHub
parent 25dd8d5ceb
commit dc9e590b7b
6 changed files with 61 additions and 7 deletions
+4
View File
@@ -2,6 +2,7 @@ package dashboards
import (
"context"
"errors"
"strings"
"github.com/grafana/grafana/pkg/infra/metrics"
@@ -212,6 +213,9 @@ func GetInheritedScopes(ctx context.Context, orgID int64, folderUID string, fold
})
if err != nil {
if errors.Is(err, folder.ErrFolderNotFound) {
return nil, err
}
return nil, ac.ErrInternal.Errorf("could not retrieve folder parents: %w", err)
}