Skip to content

Commit ef7e311

Browse files
committed
fix(api-aco): conditional FLP checks in ListEntriesFactory
1 parent 124d635 commit ef7e311

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/api-aco/src/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class GetDefaultPermissionsWithTeams implements IGetDefaultPermissions {
3232

3333
const permissions = [...originalPermissions]; // Clone the original permissions to avoid mutation.
3434

35-
if (identityTeams.length) {
35+
if (identity && identityTeams.length) {
3636
for (const identityTeam of identityTeams) {
3737
// Check if the team has permissions for the folder.
3838
const teamPermission = permissions.find(

packages/api-aco/src/utils/decorators/ListEntriesFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export class ListEntriesFactory {
3737
const params = { ...initialParams, limit };
3838
const hasRootFolder = hasRootFolderId({ model, where });
3939

40-
// If we're querying the root folder, skip permission checks
41-
if (hasRootFolder) {
40+
// If FLP should be skipped, or we're querying the root folder, skip permission checks
41+
if (!this.folderLevelPermissions.canUseFolderLevelPermissions() || hasRootFolder) {
4242
return await decoratee(model, params);
4343
}
4444

0 commit comments

Comments
 (0)