Dashboard: Fix editor specific permissions in /api (#113292)
This commit is contained in:
@@ -676,11 +676,14 @@ func (dr *DashboardServiceImpl) BuildSaveDashboardCommand(ctx context.Context, d
|
||||
|
||||
// Validate folder
|
||||
if dash.FolderID != 0 || dash.FolderUID != "" { // nolint:staticcheck
|
||||
folder, err := dr.folderService.Get(ctx, &folder.GetFolderQuery{
|
||||
// use a background requester, because the user may have been granted edit access to that specific dashboard, but
|
||||
// not have access to the parent folder. we should still allow editing in that case.
|
||||
ctxIdentity, backgroundRequester := identity.WithServiceIdentity(ctx, dash.OrgID)
|
||||
folder, err := dr.folderService.Get(ctxIdentity, &folder.GetFolderQuery{
|
||||
OrgID: dash.OrgID,
|
||||
UID: &dash.FolderUID,
|
||||
ID: &dash.FolderID, // nolint:staticcheck
|
||||
SignedInUser: dto.User,
|
||||
SignedInUser: backgroundRequester,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user