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:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user