mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 05:37:53 +08:00
Nested folders: Fix move (#65526)
* Nested Folders: Fix move response Fix JSON tags to be consistent with the GET endpoint * Add API test for moving to root folder * Allow move to root folder * Fix failure message * Update OpenAPI specification
This commit is contained in:

committed by
GitHub

parent
fc16fb0407
commit
c65cd5833a
@ -359,7 +359,9 @@ func TestHTTPServer_FolderMetadata(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFolderMoveAPIEndpoint(t *testing.T) {
|
||||
folderService := &foldertest.FakeService{}
|
||||
folderService := &foldertest.FakeService{
|
||||
ExpectedFolder: &folder.Folder{},
|
||||
}
|
||||
setUpRBACGuardian(t)
|
||||
|
||||
type testCase struct {
|
||||
@ -378,6 +380,14 @@ func TestFolderMoveAPIEndpoint(t *testing.T) {
|
||||
{Action: dashboards.ActionFoldersWrite, Scope: dashboards.ScopeFoldersProvider.GetResourceScopeUID("newParentUid")},
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "can move folder to the root folder with specific permissions",
|
||||
newParentUid: "",
|
||||
expectedCode: http.StatusOK,
|
||||
permissions: []accesscontrol.Permission{
|
||||
{Action: dashboards.ActionFoldersWrite, Scope: dashboards.ScopeFoldersProvider.GetResourceScopeUID("uid")},
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "forbidden to move folder to another folder without the write access on the folder being moved",
|
||||
newParentUid: "newParentUid",
|
||||
|
Reference in New Issue
Block a user