Folders: GetFolders to return empty respons if user does not have any permissions (#81304)

add check for list of permissions
This commit is contained in:
Yuri Tseretyan
2024-01-26 19:12:45 +02:00
committed by GitHub
parent 09fcb3c6cc
commit a081abdd25
2 changed files with 14 additions and 0 deletions
@@ -1309,6 +1309,7 @@ func TestIntegrationNestedFolderSharedWithMe(t *testing.T) {
orgID: {
dashboards.ActionFoldersCreate: {},
dashboards.ActionFoldersWrite: {dashboards.ScopeFoldersAll},
dashboards.ActionFoldersRead: {dashboards.ScopeFoldersAll},
},
}}
@@ -1587,6 +1588,16 @@ func TestIntegrationNestedFolderSharedWithMe(t *testing.T) {
},
},
},
{
name: "Should not get any folders if user has no permissions",
cmd: folder.GetFoldersQuery{
OrgID: orgID,
SignedInUser: &user.SignedInUser{UserID: 999, OrgID: orgID, Permissions: map[int64]map[string][]string{
orgID: {},
}},
},
expected: nil,
},
}
for _, tc := range testCases {