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