@webiny/api-aco 6.6.0-alpha.1 → 6.6.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AcoFeature.js +14 -36
- package/AcoFeature.js.map +1 -1
- package/AcoFolderSchemaFactory.d.ts +2 -0
- package/AcoFolderSchemaFactory.js +25 -7
- package/AcoFolderSchemaFactory.js.map +1 -1
- package/domain/folder/folder.model.js +2 -1
- package/domain/folder/folder.model.js.map +1 -1
- package/exports/api/aco/flp.d.ts +3 -3
- package/exports/api/aco/flp.js +2 -3
- package/features/ai/CreateFolderTool.d.ts +11 -6
- package/features/ai/CreateFolderTool.js +20 -11
- package/features/ai/CreateFolderTool.js.map +1 -1
- package/features/ai/CreateRoleTool.d.ts +54 -0
- package/features/ai/CreateRoleTool.js +71 -0
- package/features/ai/CreateRoleTool.js.map +1 -0
- package/features/ai/CreateTeamTool.d.ts +11 -6
- package/features/ai/CreateTeamTool.js +20 -11
- package/features/ai/CreateTeamTool.js.map +1 -1
- package/features/ai/DeleteFolderTool.d.ts +48 -0
- package/features/ai/DeleteFolderTool.js +55 -0
- package/features/ai/DeleteFolderTool.js.map +1 -0
- package/features/ai/DeleteRoleTool.d.ts +52 -0
- package/features/ai/DeleteRoleTool.js +79 -0
- package/features/ai/DeleteRoleTool.js.map +1 -0
- package/features/ai/DeleteTeamTool.d.ts +46 -0
- package/features/ai/DeleteTeamTool.js +56 -0
- package/features/ai/DeleteTeamTool.js.map +1 -0
- package/features/ai/GrantFolderAccessTool.d.ts +13 -8
- package/features/ai/GrantFolderAccessTool.js +20 -11
- package/features/ai/GrantFolderAccessTool.js.map +1 -1
- package/features/ai/ListFoldersTool.d.ts +11 -6
- package/features/ai/ListFoldersTool.js +21 -12
- package/features/ai/ListFoldersTool.js.map +1 -1
- package/features/ai/ListRolesTool.d.ts +12 -7
- package/features/ai/ListRolesTool.js +21 -12
- package/features/ai/ListRolesTool.js.map +1 -1
- package/features/ai/ListTeamsTool.d.ts +14 -7
- package/features/ai/ListTeamsTool.js +23 -13
- package/features/ai/ListTeamsTool.js.map +1 -1
- package/features/ai/RevokeFolderAccessTool.d.ts +12 -7
- package/features/ai/RevokeFolderAccessTool.js +21 -12
- package/features/ai/RevokeFolderAccessTool.js.map +1 -1
- package/features/ai/UpdateFolderTool.d.ts +57 -0
- package/features/ai/UpdateFolderTool.js +72 -0
- package/features/ai/UpdateFolderTool.js.map +1 -0
- package/features/ai/UpdateRoleTool.d.ts +46 -0
- package/features/ai/UpdateRoleTool.js +53 -0
- package/features/ai/UpdateRoleTool.js.map +1 -0
- package/features/ai/UpdateTeamTool.d.ts +52 -0
- package/features/ai/UpdateTeamTool.js +56 -0
- package/features/ai/UpdateTeamTool.js.map +1 -0
- package/features/ai/feature.d.ts +2 -2
- package/features/ai/feature.js +14 -0
- package/features/ai/feature.js.map +1 -1
- package/features/ai/index.d.ts +7 -0
- package/features/ai/index.js +7 -0
- package/features/ai/loadFolderPermissions.d.ts +4 -1
- package/features/ai/loadFolderPermissions.js +1 -1
- package/features/ai/loadFolderPermissions.js.map +1 -1
- package/features/cms/decorators/ListDeletedEntriesWithFlpDecorator.d.ts +4 -4
- package/features/cms/decorators/ListDeletedEntriesWithFlpDecorator.js +7 -8
- package/features/cms/decorators/ListDeletedEntriesWithFlpDecorator.js.map +1 -1
- package/features/cms/decorators/ListEntriesWithFlpDecorator.d.ts +3 -3
- package/features/cms/decorators/ListEntriesWithFlpDecorator.js +7 -8
- package/features/cms/decorators/ListEntriesWithFlpDecorator.js.map +1 -1
- package/features/cms/decorators/ListLatestEntriesWithFlpDecorator.d.ts +4 -4
- package/features/cms/decorators/ListLatestEntriesWithFlpDecorator.js +7 -8
- package/features/cms/decorators/ListLatestEntriesWithFlpDecorator.js.map +1 -1
- package/features/cms/decorators/ListPublishedEntriesWithFlpDecorator.d.ts +4 -4
- package/features/cms/decorators/ListPublishedEntriesWithFlpDecorator.js +7 -8
- package/features/cms/decorators/ListPublishedEntriesWithFlpDecorator.js.map +1 -1
- package/features/flp/CreateFlp/index.d.ts +0 -1
- package/features/flp/CreateFlp/index.js +0 -1
- package/features/flp/DeleteFlp/index.d.ts +0 -1
- package/features/flp/DeleteFlp/index.js +0 -1
- package/features/flp/FolderAccessListFilter/abstractions.d.ts +33 -0
- package/features/flp/FolderAccessListFilter/abstractions.js +5 -0
- package/features/flp/FolderAccessListFilter/abstractions.js.map +1 -0
- package/features/flp/FolderAccessListFilter/index.d.ts +1 -0
- package/features/flp/FolderAccessListFilter/index.js +1 -0
- package/features/flp/FolderCatalogSync/FolderCatalogSyncHandlersFeature.d.ts +8 -0
- package/features/flp/FolderCatalogSync/FolderCatalogSyncHandlersFeature.js +15 -0
- package/features/flp/FolderCatalogSync/FolderCatalogSyncHandlersFeature.js.map +1 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderCreatedHandler.d.ts +11 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderCreatedHandler.js +19 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderCreatedHandler.js.map +1 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderDeletedHandler.d.ts +11 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderDeletedHandler.js +19 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderDeletedHandler.js.map +1 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderUpdatedHandler.d.ts +11 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderUpdatedHandler.js +23 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderUpdatedHandler.js.map +1 -0
- package/features/flp/FolderCatalogSync/abstractions.d.ts +25 -0
- package/features/flp/FolderCatalogSync/abstractions.js +5 -0
- package/features/flp/FolderCatalogSync/abstractions.js.map +1 -0
- package/features/flp/FolderCatalogSync/index.d.ts +2 -0
- package/features/flp/FolderCatalogSync/index.js +2 -0
- package/features/flp/FolderLevelPermissions/FolderLevelPermissions.d.ts +5 -2
- package/features/flp/FolderLevelPermissions/FolderLevelPermissions.js +19 -5
- package/features/flp/FolderLevelPermissions/FolderLevelPermissions.js.map +1 -1
- package/features/flp/FolderLevelPermissions/NoopFolderLevelPermissions.d.ts +1 -0
- package/features/flp/FolderLevelPermissions/NoopFolderLevelPermissions.js +3 -0
- package/features/flp/FolderLevelPermissions/NoopFolderLevelPermissions.js.map +1 -1
- package/features/flp/FolderLevelPermissions/abstractions.d.ts +8 -2
- package/features/flp/FolderLevelPermissions/abstractions.js.map +1 -1
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.d.ts +12 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.js +22 -14
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.js.map +1 -1
- package/features/flp/FolderPermissionsRepository/abstractions.d.ts +28 -0
- package/features/flp/FolderPermissionsRepository/abstractions.js +5 -0
- package/features/flp/FolderPermissionsRepository/abstractions.js.map +1 -0
- package/features/flp/FolderPermissionsRepository/index.d.ts +1 -0
- package/features/flp/FolderPermissionsRepository/index.js +1 -0
- package/features/flp/GetFlp/GetFlpUseCase.d.ts +10 -5
- package/features/flp/GetFlp/GetFlpUseCase.js +13 -5
- package/features/flp/GetFlp/GetFlpUseCase.js.map +1 -1
- package/features/flp/GetFlp/decorators/GetFlpWithCodeFlps.d.ts +13 -0
- package/features/flp/GetFlp/decorators/GetFlpWithCodeFlps.js +26 -0
- package/features/flp/GetFlp/decorators/GetFlpWithCodeFlps.js.map +1 -0
- package/features/flp/GetFlp/feature.js +1 -3
- package/features/flp/GetFlp/feature.js.map +1 -1
- package/features/flp/ListFlps/ListFlpsUseCase.d.ts +11 -6
- package/features/flp/ListFlps/ListFlpsUseCase.js +13 -5
- package/features/flp/ListFlps/ListFlpsUseCase.js.map +1 -1
- package/features/flp/ListFlps/abstractions.d.ts +3 -9
- package/features/flp/ListFlps/abstractions.js.map +1 -1
- package/features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.d.ts +13 -0
- package/features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.js +27 -0
- package/features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.js.map +1 -0
- package/features/flp/ListFlps/feature.js +1 -3
- package/features/flp/ListFlps/feature.js.map +1 -1
- package/features/flp/ListFolderAccess/GetUserEntryAccessUseCase.d.ts +14 -0
- package/features/flp/ListFolderAccess/GetUserEntryAccessUseCase.js +36 -0
- package/features/flp/ListFolderAccess/GetUserEntryAccessUseCase.js.map +1 -0
- package/features/flp/ListFolderAccess/GetUserFolderAccessUseCase.d.ts +25 -0
- package/features/flp/ListFolderAccess/GetUserFolderAccessUseCase.js +75 -0
- package/features/flp/ListFolderAccess/GetUserFolderAccessUseCase.js.map +1 -0
- package/features/flp/ListFolderAccess/ListEntryAccessUseCase.d.ts +13 -0
- package/features/flp/ListFolderAccess/ListEntryAccessUseCase.js +28 -0
- package/features/flp/ListFolderAccess/ListEntryAccessUseCase.js.map +1 -0
- package/features/flp/ListFolderAccess/ListFolderAccessUseCase.d.ts +24 -0
- package/features/flp/ListFolderAccess/ListFolderAccessUseCase.js +107 -0
- package/features/flp/ListFolderAccess/ListFolderAccessUseCase.js.map +1 -0
- package/features/flp/ListFolderAccess/ListUserFolderAccessUseCase.d.ts +28 -0
- package/features/flp/ListFolderAccess/ListUserFolderAccessUseCase.js +98 -0
- package/features/flp/ListFolderAccess/ListUserFolderAccessUseCase.js.map +1 -0
- package/features/flp/ListFolderAccess/UserFolderCandidates.d.ts +13 -0
- package/features/flp/ListFolderAccess/UserFolderCandidates.js +26 -0
- package/features/flp/ListFolderAccess/UserFolderCandidates.js.map +1 -0
- package/features/flp/ListFolderAccess/abstractions.d.ts +182 -0
- package/features/flp/ListFolderAccess/abstractions.js +10 -0
- package/features/flp/ListFolderAccess/abstractions.js.map +1 -0
- package/features/flp/{CreateFlpOnFolderCreated → ListFolderAccess}/feature.d.ts +1 -1
- package/features/flp/ListFolderAccess/feature.js +21 -0
- package/features/flp/ListFolderAccess/feature.js.map +1 -0
- package/features/flp/ListFolderAccess/index.d.ts +2 -0
- package/features/flp/ListFolderAccess/index.js +2 -0
- package/features/flp/ListFolderAccess/mayAskAboutUser.d.ts +3 -0
- package/features/flp/ListFolderAccess/mayAskAboutUser.js +9 -0
- package/features/flp/ListFolderAccess/mayAskAboutUser.js.map +1 -0
- package/features/flp/ListFolderAccess/userFolderLevel.d.ts +31 -0
- package/features/flp/ListFolderAccess/userFolderLevel.js +48 -0
- package/features/flp/ListFolderAccess/userFolderLevel.js.map +1 -0
- package/features/flp/UpdateFlp/abstractions.d.ts +6 -2
- package/features/flp/UpdateFlp/abstractions.js.map +1 -1
- package/features/flp/UpdateFlp/index.d.ts +0 -1
- package/features/flp/UpdateFlp/index.js +0 -1
- package/features/flp/shared/CodeFlpMerger.d.ts +26 -0
- package/features/flp/shared/CodeFlpMerger.js +20 -0
- package/features/flp/shared/CodeFlpMerger.js.map +1 -0
- package/features/flp/shared/CodeFlpPath.d.ts +15 -0
- package/features/flp/shared/CodeFlpPath.js +29 -0
- package/features/flp/shared/CodeFlpPath.js.map +1 -0
- package/features/flp/shared/CodeFlpTarget.d.ts +10 -0
- package/features/flp/shared/CodeFlpTarget.js +26 -0
- package/features/flp/shared/CodeFlpTarget.js.map +1 -0
- package/features/flp/shared/CodeFlpsProvider.d.ts +15 -0
- package/features/flp/shared/CodeFlpsProvider.js +36 -0
- package/features/flp/shared/CodeFlpsProvider.js.map +1 -0
- package/features/flp/shared/abstractions.d.ts +79 -0
- package/features/flp/shared/abstractions.js +19 -0
- package/features/flp/shared/abstractions.js.map +1 -0
- package/features/flp/shared/feature.d.ts +5 -0
- package/features/flp/shared/feature.js +17 -0
- package/features/flp/shared/feature.js.map +1 -0
- package/features/flp/shared/index.d.ts +4 -0
- package/features/flp/shared/index.js +4 -0
- package/features/folder/CreateFolder/decorators/CreateFolderWithFolderLevelPermissions.d.ts +9 -1
- package/features/folder/CreateFolder/decorators/CreateFolderWithFolderLevelPermissions.js +20 -3
- package/features/folder/CreateFolder/decorators/CreateFolderWithFolderLevelPermissions.js.map +1 -1
- package/features/folder/ListFolders/decorators/ListFoldersWithFolderLevelPermissions.d.ts +3 -7
- package/features/folder/ListFolders/decorators/ListFoldersWithFolderLevelPermissions.js +5 -50
- package/features/folder/ListFolders/decorators/ListFoldersWithFolderLevelPermissions.js.map +1 -1
- package/features/folder/NotifyFolderChange/NotifyFolderChangeUseCase.d.ts +11 -0
- package/features/folder/NotifyFolderChange/NotifyFolderChangeUseCase.js +38 -0
- package/features/folder/NotifyFolderChange/NotifyFolderChangeUseCase.js.map +1 -0
- package/features/{flp/DeleteFlpOnFolderDeleted/DeleteFlpOnFolderDeletedHandler.d.ts → folder/NotifyFolderChange/NotifyOnFolderDeletedHandler.d.ts} +5 -7
- package/features/folder/NotifyFolderChange/NotifyOnFolderDeletedHandler.js +24 -0
- package/features/folder/NotifyFolderChange/NotifyOnFolderDeletedHandler.js.map +1 -0
- package/features/folder/NotifyFolderChange/abstractions.d.ts +28 -0
- package/features/folder/NotifyFolderChange/abstractions.js +8 -0
- package/features/folder/NotifyFolderChange/abstractions.js.map +1 -0
- package/features/folder/NotifyFolderChange/feature.d.ts +8 -0
- package/features/folder/NotifyFolderChange/feature.js +13 -0
- package/features/folder/NotifyFolderChange/feature.js.map +1 -0
- package/features/folder/NotifyFolderChange/index.d.ts +2 -0
- package/features/folder/NotifyFolderChange/index.js +2 -0
- package/features/folder/UpdateFolder/UpdateFolderUseCase.d.ts +1 -0
- package/features/folder/UpdateFolder/UpdateFolderUseCase.js +13 -0
- package/features/folder/UpdateFolder/UpdateFolderUseCase.js.map +1 -1
- package/features/folder/UpdateFolder/decorators/UpdateFolderWithFolderLevelPermissions.d.ts +14 -1
- package/features/folder/UpdateFolder/decorators/UpdateFolderWithFolderLevelPermissions.js +54 -4
- package/features/folder/UpdateFolder/decorators/UpdateFolderWithFolderLevelPermissions.js.map +1 -1
- package/filter/filter.model.js +2 -1
- package/filter/filter.model.js.map +1 -1
- package/filter/filter.so.d.ts +0 -2
- package/filter/filter.so.js +20 -8
- package/filter/filter.so.js.map +1 -1
- package/flp/flp.types.d.ts +6 -1
- package/flp/index.d.ts +0 -1
- package/flp/index.js +0 -1
- package/flpTaskCatalog/CatalogFolderPermissionsRepository.d.ts +17 -0
- package/flpTaskCatalog/CatalogFolderPermissionsRepository.js +34 -0
- package/flpTaskCatalog/CatalogFolderPermissionsRepository.js.map +1 -0
- package/flpTaskCatalog/PostLoadFolderAccessListFilter.d.ts +24 -0
- package/flpTaskCatalog/PostLoadFolderAccessListFilter.js +63 -0
- package/flpTaskCatalog/PostLoadFolderAccessListFilter.js.map +1 -0
- package/flpTaskCatalog/TaskCatalogFlpFeature.d.ts +12 -0
- package/flpTaskCatalog/TaskCatalogFlpFeature.js +49 -0
- package/flpTaskCatalog/TaskCatalogFlpFeature.js.map +1 -0
- package/flpTaskCatalog/TaskFolderCatalogSync.d.ts +29 -0
- package/flpTaskCatalog/TaskFolderCatalogSync.js +57 -0
- package/flpTaskCatalog/TaskFolderCatalogSync.js.map +1 -0
- package/{flp → flpTaskCatalog}/flp.crud.d.ts +1 -1
- package/flpTaskCatalog/flp.crud.js.map +1 -0
- package/flpTaskCatalog/index.d.ts +1 -0
- package/flpTaskCatalog/index.js +1 -0
- package/{utils/decorators → flpTaskCatalog/listEntries}/ListEntriesFactory.d.ts +1 -1
- package/flpTaskCatalog/listEntries/ListEntriesFactory.js.map +1 -0
- package/flpTaskCatalog/listEntries/hasRootFolderId.js.map +1 -0
- package/{utils/decorators → flpTaskCatalog/listEntries}/isPageModel.js +1 -1
- package/flpTaskCatalog/listEntries/isPageModel.js.map +1 -0
- package/flpTaskCatalog/tasks/createFlp.task.d.ts +25 -0
- package/{flp → flpTaskCatalog}/tasks/createFlp.task.js +34 -17
- package/flpTaskCatalog/tasks/createFlp.task.js.map +1 -0
- package/flpTaskCatalog/tasks/deleteFlp.task.d.ts +23 -0
- package/{flp → flpTaskCatalog}/tasks/deleteFlp.task.js +24 -15
- package/flpTaskCatalog/tasks/deleteFlp.task.js.map +1 -0
- package/{flp → flpTaskCatalog}/tasks/syncFlp.task.d.ts +11 -6
- package/{flp → flpTaskCatalog}/tasks/syncFlp.task.js +45 -29
- package/flpTaskCatalog/tasks/syncFlp.task.js.map +1 -0
- package/flpTaskCatalog/tasks/updateFlp.task.d.ts +25 -0
- package/flpTaskCatalog/tasks/updateFlp.task.js +64 -0
- package/flpTaskCatalog/tasks/updateFlp.task.js.map +1 -0
- package/flpTaskCatalog/useCases/CreateFlpUseCase.d.ts +8 -0
- package/{features/flp/CreateFlp → flpTaskCatalog/useCases}/CreateFlpUseCase.js +1 -1
- package/flpTaskCatalog/useCases/CreateFlpUseCase.js.map +1 -0
- package/flpTaskCatalog/useCases/DeleteFlpUseCase.d.ts +8 -0
- package/flpTaskCatalog/useCases/DeleteFlpUseCase.js.map +1 -0
- package/{features/flp/UpdateFlp → flpTaskCatalog/useCases}/UpdateFlpUseCase.d.ts +8 -9
- package/{features/flp/UpdateFlp → flpTaskCatalog/useCases}/UpdateFlpUseCase.js +23 -30
- package/flpTaskCatalog/useCases/UpdateFlpUseCase.js.map +1 -0
- package/folder/createFolderTypeDefs.js +4 -1
- package/folder/createFolderTypeDefs.js.map +1 -1
- package/folder/folder.types.d.ts +2 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +21 -22
- package/types.d.ts +2 -3
- package/types.js.map +1 -1
- package/utils/createOperationsWrapper.d.ts +2 -2
- package/utils/createOperationsWrapper.js +5 -5
- package/utils/createOperationsWrapper.js.map +1 -1
- package/features/flp/CreateFlp/CreateFlpUseCase.d.ts +0 -8
- package/features/flp/CreateFlp/CreateFlpUseCase.js.map +0 -1
- package/features/flp/CreateFlp/feature.d.ts +0 -5
- package/features/flp/CreateFlp/feature.js +0 -13
- package/features/flp/CreateFlp/feature.js.map +0 -1
- package/features/flp/CreateFlpOnFolderCreated/CreateFlpOnFolderCreatedHandler.d.ts +0 -14
- package/features/flp/CreateFlpOnFolderCreated/CreateFlpOnFolderCreatedHandler.js +0 -37
- package/features/flp/CreateFlpOnFolderCreated/CreateFlpOnFolderCreatedHandler.js.map +0 -1
- package/features/flp/CreateFlpOnFolderCreated/feature.js +0 -11
- package/features/flp/CreateFlpOnFolderCreated/feature.js.map +0 -1
- package/features/flp/CreateFlpOnFolderCreated/index.d.ts +0 -1
- package/features/flp/CreateFlpOnFolderCreated/index.js +0 -1
- package/features/flp/DeleteFlp/DeleteFlpUseCase.d.ts +0 -8
- package/features/flp/DeleteFlp/DeleteFlpUseCase.js.map +0 -1
- package/features/flp/DeleteFlp/feature.d.ts +0 -5
- package/features/flp/DeleteFlp/feature.js +0 -13
- package/features/flp/DeleteFlp/feature.js.map +0 -1
- package/features/flp/DeleteFlpOnFolderDeleted/DeleteFlpOnFolderDeletedHandler.js +0 -37
- package/features/flp/DeleteFlpOnFolderDeleted/DeleteFlpOnFolderDeletedHandler.js.map +0 -1
- package/features/flp/DeleteFlpOnFolderDeleted/feature.d.ts +0 -4
- package/features/flp/DeleteFlpOnFolderDeleted/feature.js +0 -11
- package/features/flp/DeleteFlpOnFolderDeleted/feature.js.map +0 -1
- package/features/flp/DeleteFlpOnFolderDeleted/index.d.ts +0 -1
- package/features/flp/DeleteFlpOnFolderDeleted/index.js +0 -1
- package/features/flp/UpdateFlp/UpdateFlpUseCase.js.map +0 -1
- package/features/flp/UpdateFlp/feature.d.ts +0 -5
- package/features/flp/UpdateFlp/feature.js +0 -17
- package/features/flp/UpdateFlp/feature.js.map +0 -1
- package/features/flp/UpdateFlpOnFolderUpdated/UpdateFlpOnFolderUpdatedHandler.d.ts +0 -14
- package/features/flp/UpdateFlpOnFolderUpdated/UpdateFlpOnFolderUpdatedHandler.js +0 -39
- package/features/flp/UpdateFlpOnFolderUpdated/UpdateFlpOnFolderUpdatedHandler.js.map +0 -1
- package/features/flp/UpdateFlpOnFolderUpdated/feature.d.ts +0 -4
- package/features/flp/UpdateFlpOnFolderUpdated/feature.js +0 -11
- package/features/flp/UpdateFlpOnFolderUpdated/feature.js.map +0 -1
- package/features/flp/UpdateFlpOnFolderUpdated/index.d.ts +0 -1
- package/features/flp/UpdateFlpOnFolderUpdated/index.js +0 -1
- package/flp/flp.crud.js.map +0 -1
- package/flp/tasks/createFlp.task.d.ts +0 -18
- package/flp/tasks/createFlp.task.js.map +0 -1
- package/flp/tasks/deleteFlp.task.d.ts +0 -18
- package/flp/tasks/deleteFlp.task.js.map +0 -1
- package/flp/tasks/syncFlp.task.js.map +0 -1
- package/flp/tasks/updateFlp.task.d.ts +0 -18
- package/flp/tasks/updateFlp.task.js +0 -43
- package/flp/tasks/updateFlp.task.js.map +0 -1
- package/utils/decorators/CmsEntriesCrudDecorators.d.ts +0 -11
- package/utils/decorators/CmsEntriesCrudDecorators.js +0 -179
- package/utils/decorators/CmsEntriesCrudDecorators.js.map +0 -1
- package/utils/decorators/FilterEntriesByFolderFactory.d.ts +0 -7
- package/utils/decorators/FilterEntriesByFolderFactory.js +0 -22
- package/utils/decorators/FilterEntriesByFolderFactory.js.map +0 -1
- package/utils/decorators/ListEntriesFactory.js.map +0 -1
- package/utils/decorators/hasRootFolderId.js.map +0 -1
- package/utils/decorators/isPageModel.js.map +0 -1
- /package/{flp → flpTaskCatalog}/flp.crud.js +0 -0
- /package/{utils/decorators → flpTaskCatalog/listEntries}/ListEntriesFactory.js +0 -0
- /package/{utils/decorators → flpTaskCatalog/listEntries}/hasRootFolderId.d.ts +0 -0
- /package/{utils/decorators → flpTaskCatalog/listEntries}/hasRootFolderId.js +0 -0
- /package/{utils/decorators → flpTaskCatalog/listEntries}/isPageModel.d.ts +0 -0
- /package/{features/flp/DeleteFlp → flpTaskCatalog/useCases}/DeleteFlpUseCase.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/flp/FolderLevelPermissions/abstractions.js","sources":["../../../../src/features/flp/FolderLevelPermissions/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CanAccessFolderContentParams, CanAccessFolderParams } from \"./useCases/index.js\";\nimport type { FolderLevelPermission, FolderPermission
|
|
1
|
+
{"version":3,"file":"features/flp/FolderLevelPermissions/abstractions.js","sources":["../../../../src/features/flp/FolderLevelPermissions/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CanAccessFolderContentParams, CanAccessFolderParams } from \"./useCases/index.js\";\nimport type { FolderLevelPermission, FolderPermission } from \"~/types.js\";\nimport type { ListFolderPermissionsParams } from \"~/features/flp/FolderPermissionsRepository/abstractions.js\";\n\nexport interface IFolderLevelPermissions {\n canUseFolderLevelPermissions(enabled?: boolean): boolean;\n canUseTeams(): boolean;\n canCreateFolderInRoot(): boolean;\n permissionsIncludeNonInheritedPermissions(permissions: FolderPermission[]): boolean;\n canAccessFolder(params: CanAccessFolderParams): Promise<boolean>;\n canAccessFolderContent(params: CanAccessFolderContentParams): Promise<boolean>;\n ensureCanAccessFolder(params: CanAccessFolderParams): Promise<void>;\n ensureCanAccessFolderContent(params: CanAccessFolderContentParams): Promise<void>;\n canManageFolderContent(flp: FolderLevelPermission): Promise<boolean>;\n canManageFolderStructure(flp: FolderLevelPermission): Promise<boolean>;\n canManageFolderPermissions(flp: FolderLevelPermission): Promise<boolean>;\n getDefaultPermissions(permissions: FolderPermission[]): Promise<FolderPermission[]>;\n /**\n * `getDefaultPermissions` for many folders at once: the identity's teams and permissions are\n * looked up once, not once per folder. Results are in the order of the input.\n */\n getDefaultPermissionsBatch(\n permissionsList: FolderPermission[][]\n ): Promise<FolderPermission[][]>;\n listFolderLevelPermissions(params: ListFolderPermissionsParams): Promise<\n Array<{\n id: string;\n permissions: FolderPermission[];\n }>\n >;\n getFolderLevelPermissions(id: string): Promise<FolderPermission[]>;\n}\n\n/** Manage folder-level access control. */\nexport const FolderLevelPermissions =\n createAbstraction<IFolderLevelPermissions>(\"FolderLevelPermissions\");\n\nexport namespace FolderLevelPermissions {\n export type Interface = IFolderLevelPermissions;\n}\n"],"names":["FolderLevelPermissions","createAbstraction"],"mappings":";AAmCO,MAAMA,yBACTC,kBAA2C"}
|
|
@@ -2,10 +2,22 @@ import type { IGetDefaultPermissions } from "./IGetDefaultPermissions.js";
|
|
|
2
2
|
import type { FolderPermission } from "../../../../../flp/flp.types.js";
|
|
3
3
|
import type { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
4
4
|
import { ListUserTeamsUseCase } from "@webiny/api-core/features/users/ListUserTeams/index.js";
|
|
5
|
+
import type { SecurityIdentity, Team } from "@webiny/api-core/types/security.js";
|
|
6
|
+
/**
|
|
7
|
+
* For every team of the identity that has a permission on the folder, grants the identity the same
|
|
8
|
+
* level, marked as inherited from the team. Returns a new list; the given one is not changed.
|
|
9
|
+
*/
|
|
10
|
+
export declare const expandTeamPermissions: (identity: SecurityIdentity | undefined, identityTeams: Team[], originalPermissions: FolderPermission[]) => FolderPermission[];
|
|
5
11
|
export declare class GetDefaultPermissionsWithTeams implements IGetDefaultPermissions {
|
|
6
12
|
private identityContext;
|
|
7
13
|
private listUserTeamsUseCase;
|
|
8
14
|
private decoretee;
|
|
15
|
+
/**
|
|
16
|
+
* The identity's teams, loaded once per instance and identity. An instance lives for one
|
|
17
|
+
* `getDefaultPermissions` call or one `listFolderLevelPermissions` call, so nothing is kept
|
|
18
|
+
* between calls or requests.
|
|
19
|
+
*/
|
|
20
|
+
private loaded;
|
|
9
21
|
constructor(identityContext: IdentityContext.Interface, listUserTeamsUseCase: ListUserTeamsUseCase.Interface, decoretee: IGetDefaultPermissions);
|
|
10
22
|
execute(originalPermissions: FolderPermission[]): Promise<FolderPermission[]>;
|
|
11
23
|
}
|
|
@@ -1,27 +1,35 @@
|
|
|
1
|
+
const expandTeamPermissions = (identity, identityTeams, originalPermissions)=>{
|
|
2
|
+
const permissions = [
|
|
3
|
+
...originalPermissions
|
|
4
|
+
];
|
|
5
|
+
if (identity && identityTeams.length) for (const identityTeam of identityTeams){
|
|
6
|
+
const teamPermission = permissions.find((p)=>p.target === `team:${identityTeam.slug}`);
|
|
7
|
+
if (teamPermission) permissions.push({
|
|
8
|
+
target: `admin:${identity.id}`,
|
|
9
|
+
level: teamPermission.level,
|
|
10
|
+
inheritedFrom: "team:" + identityTeam.slug
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return permissions;
|
|
14
|
+
};
|
|
1
15
|
class GetDefaultPermissionsWithTeams {
|
|
2
16
|
constructor(identityContext, listUserTeamsUseCase, decoretee){
|
|
17
|
+
this.loaded = null;
|
|
3
18
|
this.identityContext = identityContext;
|
|
4
19
|
this.listUserTeamsUseCase = listUserTeamsUseCase;
|
|
5
20
|
this.decoretee = decoretee;
|
|
6
21
|
}
|
|
7
22
|
async execute(originalPermissions) {
|
|
8
23
|
const identity = this.identityContext.getIdentity();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const teamPermission = permissions.find((p)=>p.target === `team:${identityTeam.slug}`);
|
|
16
|
-
if (teamPermission) permissions.push({
|
|
17
|
-
target: `admin:${identity.id}`,
|
|
18
|
-
level: teamPermission.level,
|
|
19
|
-
inheritedFrom: "team:" + identityTeam.slug
|
|
20
|
-
});
|
|
21
|
-
}
|
|
24
|
+
if (!this.loaded || this.loaded.identityId !== identity.id) this.loaded = {
|
|
25
|
+
identityId: identity.id,
|
|
26
|
+
teams: this.listUserTeamsUseCase.execute(identity.id).then((result)=>result.isOk() ? result.value : [])
|
|
27
|
+
};
|
|
28
|
+
const identityTeams = await this.loaded.teams;
|
|
29
|
+
const permissions = expandTeamPermissions(identity, identityTeams, originalPermissions);
|
|
22
30
|
return await this.decoretee.execute(permissions);
|
|
23
31
|
}
|
|
24
32
|
}
|
|
25
|
-
export { GetDefaultPermissionsWithTeams };
|
|
33
|
+
export { GetDefaultPermissionsWithTeams, expandTeamPermissions };
|
|
26
34
|
|
|
27
35
|
//# sourceMappingURL=GetDefaultPermissionsWithTeams.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.js","sources":["../../../../../../src/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.ts"],"sourcesContent":["import type { IGetDefaultPermissions } from \"./IGetDefaultPermissions.js\";\nimport type { FolderPermission } from \"~/flp/flp.types.js\";\nimport type { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { ListUserTeamsUseCase } from \"@webiny/api-core/features/users/ListUserTeams/index.js\";\nimport type { Team } from \"@webiny/api-core/types/security.js\";\n\nexport class GetDefaultPermissionsWithTeams implements IGetDefaultPermissions {\n private identityContext: IdentityContext.Interface;\n private listUserTeamsUseCase: ListUserTeamsUseCase.Interface;\n private decoretee: IGetDefaultPermissions;\n\n constructor(\n identityContext: IdentityContext.Interface,\n listUserTeamsUseCase: ListUserTeamsUseCase.Interface,\n decoretee: IGetDefaultPermissions\n ) {\n this.identityContext = identityContext;\n this.listUserTeamsUseCase = listUserTeamsUseCase;\n this.decoretee = decoretee;\n }\n\n async execute(originalPermissions: FolderPermission[]) {\n /**\n * Retrieves the list of teams the current identity belongs to and checks if any of these teams\n * have permissions for the folder. If a team has permissions, the current identity is granted\n * the same permissions, inheriting them from the team.\n */\n const identity = this.identityContext.getIdentity();\n\n // Get teams for current identity
|
|
1
|
+
{"version":3,"file":"features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.js","sources":["../../../../../../src/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.ts"],"sourcesContent":["import type { IGetDefaultPermissions } from \"./IGetDefaultPermissions.js\";\nimport type { FolderPermission } from \"~/flp/flp.types.js\";\nimport type { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { ListUserTeamsUseCase } from \"@webiny/api-core/features/users/ListUserTeams/index.js\";\nimport type { SecurityIdentity, Team } from \"@webiny/api-core/types/security.js\";\n\n/**\n * For every team of the identity that has a permission on the folder, grants the identity the same\n * level, marked as inherited from the team. Returns a new list; the given one is not changed.\n */\nexport const expandTeamPermissions = (\n identity: SecurityIdentity | undefined,\n identityTeams: Team[],\n originalPermissions: FolderPermission[]\n): FolderPermission[] => {\n const permissions = [...originalPermissions]; // Clone the original permissions to avoid mutation.\n\n if (identity && identityTeams.length) {\n for (const identityTeam of identityTeams) {\n // Check if the team has permissions for the folder.\n const teamPermission = permissions.find(p => p.target === `team:${identityTeam.slug}`);\n\n if (teamPermission) {\n // Grant the current identity the same permissions as the team, marking them as inherited.\n permissions.push({\n target: `admin:${identity.id}`,\n level: teamPermission.level,\n inheritedFrom: \"team:\" + identityTeam.slug\n });\n }\n }\n }\n\n return permissions;\n};\n\ninterface LoadedTeams {\n identityId: string;\n teams: Promise<Team[]>;\n}\n\nexport class GetDefaultPermissionsWithTeams implements IGetDefaultPermissions {\n private identityContext: IdentityContext.Interface;\n private listUserTeamsUseCase: ListUserTeamsUseCase.Interface;\n private decoretee: IGetDefaultPermissions;\n /**\n * The identity's teams, loaded once per instance and identity. An instance lives for one\n * `getDefaultPermissions` call or one `listFolderLevelPermissions` call, so nothing is kept\n * between calls or requests.\n */\n private loaded: LoadedTeams | null = null;\n\n constructor(\n identityContext: IdentityContext.Interface,\n listUserTeamsUseCase: ListUserTeamsUseCase.Interface,\n decoretee: IGetDefaultPermissions\n ) {\n this.identityContext = identityContext;\n this.listUserTeamsUseCase = listUserTeamsUseCase;\n this.decoretee = decoretee;\n }\n\n async execute(originalPermissions: FolderPermission[]) {\n /**\n * Retrieves the list of teams the current identity belongs to and checks if any of these teams\n * have permissions for the folder. If a team has permissions, the current identity is granted\n * the same permissions, inheriting them from the team.\n */\n const identity = this.identityContext.getIdentity();\n\n // Get teams for current identity (once per instance and identity).\n if (!this.loaded || this.loaded.identityId !== identity.id) {\n this.loaded = {\n identityId: identity.id,\n teams: this.listUserTeamsUseCase.execute(identity.id).then(result => {\n return result.isOk() ? result.value : [];\n })\n };\n }\n const identityTeams: Team[] = await this.loaded.teams;\n\n const permissions = expandTeamPermissions(identity, identityTeams, originalPermissions);\n\n return await this.decoretee.execute(permissions);\n }\n}\n"],"names":["expandTeamPermissions","identity","identityTeams","originalPermissions","permissions","identityTeam","teamPermission","p","GetDefaultPermissionsWithTeams","identityContext","listUserTeamsUseCase","decoretee","result"],"mappings":"AAUO,MAAMA,wBAAwB,CACjCC,UACAC,eACAC;IAEA,MAAMC,cAAc;WAAID;KAAoB;IAE5C,IAAIF,YAAYC,cAAc,MAAM,EAChC,KAAK,MAAMG,gBAAgBH,cAAe;QAEtC,MAAMI,iBAAiBF,YAAY,IAAI,CAACG,CAAAA,IAAKA,EAAE,MAAM,KAAK,CAAC,KAAK,EAAEF,aAAa,IAAI,EAAE;QAErF,IAAIC,gBAEAF,YAAY,IAAI,CAAC;YACb,QAAQ,CAAC,MAAM,EAAEH,SAAS,EAAE,EAAE;YAC9B,OAAOK,eAAe,KAAK;YAC3B,eAAe,UAAUD,aAAa,IAAI;QAC9C;IAER;IAGJ,OAAOD;AACX;AAOO,MAAMI;IAWT,YACIC,eAA0C,EAC1CC,oBAAoD,EACpDC,SAAiC,CACnC;QAPD,KACO,MAAM,GAAuB;QAOjC,IAAI,CAAC,eAAe,GAAGF;QACvB,IAAI,CAAC,oBAAoB,GAAGC;QAC5B,IAAI,CAAC,SAAS,GAAGC;IACrB;IAEA,MAAM,QAAQR,mBAAuC,EAAE;QAMnD,MAAMF,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW;QAGjD,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,KAAKA,SAAS,EAAE,EACtD,IAAI,CAAC,MAAM,GAAG;YACV,YAAYA,SAAS,EAAE;YACvB,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAACA,SAAS,EAAE,EAAE,IAAI,CAACW,CAAAA,SAChDA,OAAO,IAAI,KAAKA,OAAO,KAAK,GAAG,EAAE;QAEhD;QAEJ,MAAMV,gBAAwB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK;QAErD,MAAME,cAAcJ,sBAAsBC,UAAUC,eAAeC;QAEnE,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACC;IACxC;AACJ"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FolderLevelPermission } from "../../../flp/flp.types.js";
|
|
2
|
+
export interface ListFolderPermissionsParams {
|
|
3
|
+
where: {
|
|
4
|
+
type: string;
|
|
5
|
+
parentId?: string;
|
|
6
|
+
/** Folders whose path (e.g. `root/a`) starts with this. */
|
|
7
|
+
path_startsWith?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface IFolderPermissionsRepository {
|
|
11
|
+
/**
|
|
12
|
+
* The folder's stored permissions: its own, plus the ones it inherits from its ancestors
|
|
13
|
+
* (marked `inheritedFrom: "parent:<id>"`). Code-defined permissions and the current identity's
|
|
14
|
+
* team and role permissions are not included; those are applied on top by the callers.
|
|
15
|
+
*/
|
|
16
|
+
get(folderId: string): Promise<FolderLevelPermission | null>;
|
|
17
|
+
/** The same, for every folder of a type, optionally only the children of one folder. */
|
|
18
|
+
list(params: ListFolderPermissionsParams): Promise<FolderLevelPermission[]>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Where folder permissions are read from. Every storage provides its own: some keep a catalog with
|
|
22
|
+
* the inherited permissions copied into each folder, others work them out when reading.
|
|
23
|
+
*/
|
|
24
|
+
export declare const FolderPermissionsRepository: import("@webiny/di").Abstraction<IFolderPermissionsRepository>;
|
|
25
|
+
export declare namespace FolderPermissionsRepository {
|
|
26
|
+
type Interface = IFolderPermissionsRepository;
|
|
27
|
+
type ListParams = ListFolderPermissionsParams;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/flp/FolderPermissionsRepository/abstractions.js","sources":["../../../../src/features/flp/FolderPermissionsRepository/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { FolderLevelPermission } from \"~/flp/flp.types.js\";\n\nexport interface ListFolderPermissionsParams {\n where: {\n type: string;\n parentId?: string;\n /** Folders whose path (e.g. `root/a`) starts with this. */\n path_startsWith?: string;\n };\n}\n\nexport interface IFolderPermissionsRepository {\n /**\n * The folder's stored permissions: its own, plus the ones it inherits from its ancestors\n * (marked `inheritedFrom: \"parent:<id>\"`). Code-defined permissions and the current identity's\n * team and role permissions are not included; those are applied on top by the callers.\n */\n get(folderId: string): Promise<FolderLevelPermission | null>;\n /** The same, for every folder of a type, optionally only the children of one folder. */\n list(params: ListFolderPermissionsParams): Promise<FolderLevelPermission[]>;\n}\n\n/**\n * Where folder permissions are read from. Every storage provides its own: some keep a catalog with\n * the inherited permissions copied into each folder, others work them out when reading.\n */\nexport const FolderPermissionsRepository = createAbstraction<IFolderPermissionsRepository>(\n \"Aco/FolderPermissionsRepository\"\n);\n\nexport namespace FolderPermissionsRepository {\n export type Interface = IFolderPermissionsRepository;\n export type ListParams = ListFolderPermissionsParams;\n}\n"],"names":["FolderPermissionsRepository","createAbstraction"],"mappings":";AA2BO,MAAMA,8BAA8BC,kBACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./abstractions.js";
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { GetFlpUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
2
|
+
import { FolderPermissionsRepository } from "../../../features/flp/FolderPermissionsRepository/index.js";
|
|
3
|
+
import type { FolderLevelPermission } from "../../../flp/flp.types.js";
|
|
4
|
+
declare class GetFlpUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
5
|
+
private repository;
|
|
6
|
+
constructor(repository: FolderPermissionsRepository.Interface);
|
|
6
7
|
execute(id: string): Promise<FolderLevelPermission | null>;
|
|
7
8
|
}
|
|
9
|
+
export declare const GetFlpUseCase: typeof GetFlpUseCaseImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetFolderPermission>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { GetFlpUseCase } from "./abstractions.js";
|
|
2
|
+
import { FolderPermissionsRepository } from "../FolderPermissionsRepository/index.js";
|
|
3
|
+
class GetFlpUseCaseImpl {
|
|
4
|
+
constructor(repository){
|
|
5
|
+
this.repository = repository;
|
|
4
6
|
}
|
|
5
7
|
async execute(id) {
|
|
6
|
-
return this.get(id);
|
|
8
|
+
return this.repository.get(id);
|
|
7
9
|
}
|
|
8
10
|
}
|
|
9
|
-
|
|
11
|
+
const GetFlpUseCase_GetFlpUseCase = GetFlpUseCase.createImplementation({
|
|
12
|
+
implementation: GetFlpUseCaseImpl,
|
|
13
|
+
dependencies: [
|
|
14
|
+
FolderPermissionsRepository
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
export { GetFlpUseCase_GetFlpUseCase as GetFlpUseCase };
|
|
10
18
|
|
|
11
19
|
//# sourceMappingURL=GetFlpUseCase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/flp/GetFlp/GetFlpUseCase.js","sources":["../../../../src/features/flp/GetFlp/GetFlpUseCase.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"features/flp/GetFlp/GetFlpUseCase.js","sources":["../../../../src/features/flp/GetFlp/GetFlpUseCase.ts"],"sourcesContent":["import { GetFlpUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { FolderPermissionsRepository } from \"~/features/flp/FolderPermissionsRepository/index.js\";\nimport type { FolderLevelPermission } from \"~/flp/flp.types.js\";\n\nclass GetFlpUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private repository: FolderPermissionsRepository.Interface) {}\n\n async execute(id: string): Promise<FolderLevelPermission | null> {\n return this.repository.get(id);\n }\n}\n\nexport const GetFlpUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetFlpUseCaseImpl,\n dependencies: [FolderPermissionsRepository]\n});\n"],"names":["GetFlpUseCaseImpl","repository","id","GetFlpUseCase","UseCaseAbstraction","FolderPermissionsRepository"],"mappings":";;AAIA,MAAMA;IACF,YAAoBC,UAAiD,CAAE;aAAnDA,UAAU,GAAVA;IAAoD;IAExE,MAAM,QAAQC,EAAU,EAAyC;QAC7D,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAACA;IAC/B;AACJ;AAEO,MAAMC,8BAAgBC,cAAAA,oBAAuC,CAAC;IACjE,gBAAgBJ;IAChB,cAAc;QAACK;KAA4B;AAC/C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GetFlpUseCase } from "../abstractions.js";
|
|
2
|
+
import { CodeFlpsProvider } from "../../../../features/flp/shared/index.js";
|
|
3
|
+
import type { FolderLevelPermission } from "../../../../flp/flp.types.js";
|
|
4
|
+
declare class GetFlpWithCodeFlpsImpl implements GetFlpUseCase.Interface {
|
|
5
|
+
private codeFlpsProvider;
|
|
6
|
+
private decoratee;
|
|
7
|
+
constructor(codeFlpsProvider: CodeFlpsProvider.Interface, decoratee: GetFlpUseCase.Interface);
|
|
8
|
+
execute(id: string): Promise<FolderLevelPermission | null>;
|
|
9
|
+
}
|
|
10
|
+
export declare const GetFlpWithCodeFlps: typeof GetFlpWithCodeFlpsImpl & {
|
|
11
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions.js").IGetFolderPermission>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { GetFlpUseCase } from "../abstractions.js";
|
|
2
|
+
import { CodeFlpMerger, CodeFlpsProvider } from "../../shared/index.js";
|
|
3
|
+
class GetFlpWithCodeFlpsImpl {
|
|
4
|
+
constructor(codeFlpsProvider, decoratee){
|
|
5
|
+
this.codeFlpsProvider = codeFlpsProvider;
|
|
6
|
+
this.decoratee = decoratee;
|
|
7
|
+
}
|
|
8
|
+
async execute(id) {
|
|
9
|
+
const flp = await this.decoratee.execute(id);
|
|
10
|
+
if (!flp) return null;
|
|
11
|
+
const codePermissions = await this.codeFlpsProvider.getPermissions({
|
|
12
|
+
type: flp.type,
|
|
13
|
+
path: flp.path
|
|
14
|
+
});
|
|
15
|
+
return CodeFlpMerger.merge(flp, codePermissions);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const GetFlpWithCodeFlps = GetFlpUseCase.createDecorator({
|
|
19
|
+
decorator: GetFlpWithCodeFlpsImpl,
|
|
20
|
+
dependencies: [
|
|
21
|
+
CodeFlpsProvider
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
export { GetFlpWithCodeFlps };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=GetFlpWithCodeFlps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/flp/GetFlp/decorators/GetFlpWithCodeFlps.js","sources":["../../../../../src/features/flp/GetFlp/decorators/GetFlpWithCodeFlps.ts"],"sourcesContent":["import { GetFlpUseCase } from \"../abstractions.js\";\nimport { CodeFlpMerger, CodeFlpsProvider } from \"~/features/flp/shared/index.js\";\nimport type { FolderLevelPermission } from \"~/flp/flp.types.js\";\n\nclass GetFlpWithCodeFlpsImpl implements GetFlpUseCase.Interface {\n constructor(\n private codeFlpsProvider: CodeFlpsProvider.Interface,\n private decoratee: GetFlpUseCase.Interface\n ) {}\n\n async execute(id: string): Promise<FolderLevelPermission | null> {\n const flp = await this.decoratee.execute(id);\n\n if (!flp) {\n return null;\n }\n\n const codePermissions = await this.codeFlpsProvider.getPermissions({\n type: flp.type,\n path: flp.path\n });\n\n return CodeFlpMerger.merge(flp, codePermissions);\n }\n}\n\nexport const GetFlpWithCodeFlps = GetFlpUseCase.createDecorator({\n decorator: GetFlpWithCodeFlpsImpl,\n dependencies: [CodeFlpsProvider]\n});\n"],"names":["GetFlpWithCodeFlpsImpl","codeFlpsProvider","decoratee","id","flp","codePermissions","CodeFlpMerger","GetFlpWithCodeFlps","GetFlpUseCase","CodeFlpsProvider"],"mappings":";;AAIA,MAAMA;IACF,YACYC,gBAA4C,EAC5CC,SAAkC,CAC5C;aAFUD,gBAAgB,GAAhBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,QAAQC,EAAU,EAAyC;QAC7D,MAAMC,MAAM,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACD;QAEzC,IAAI,CAACC,KACD,OAAO;QAGX,MAAMC,kBAAkB,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC;YAC/D,MAAMD,IAAI,IAAI;YACd,MAAMA,IAAI,IAAI;QAClB;QAEA,OAAOE,cAAc,KAAK,CAACF,KAAKC;IACpC;AACJ;AAEO,MAAME,qBAAqBC,cAAc,eAAe,CAAC;IAC5D,WAAWR;IACX,cAAc;QAACS;KAAiB;AACpC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api";
|
|
2
2
|
import { GetFlpUseCase } from "./GetFlpUseCase.js";
|
|
3
|
-
import { GetFlpUseCase as external_abstractions_js_GetFlpUseCase } from "./abstractions.js";
|
|
4
|
-
import { AcoFlpCrud } from "../../folder/shared/abstractions.js";
|
|
5
3
|
const GetFlpFeature = createFeature({
|
|
6
4
|
name: "GetFlpFeature",
|
|
7
5
|
register (container) {
|
|
8
|
-
container.
|
|
6
|
+
container.register(GetFlpUseCase);
|
|
9
7
|
}
|
|
10
8
|
});
|
|
11
9
|
export { GetFlpFeature };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/flp/GetFlp/feature.js","sources":["../../../../src/features/flp/GetFlp/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetFlpUseCase } from \"./GetFlpUseCase.js\";\
|
|
1
|
+
{"version":3,"file":"features/flp/GetFlp/feature.js","sources":["../../../../src/features/flp/GetFlp/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetFlpUseCase } from \"./GetFlpUseCase.js\";\n\nexport const GetFlpFeature = createFeature({\n name: \"GetFlpFeature\",\n register(container) {\n container.register(GetFlpUseCase);\n }\n});\n"],"names":["GetFlpFeature","createFeature","container","GetFlpUseCase"],"mappings":";;AAGO,MAAMA,gBAAgBC,cAAc;IACvC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ListFlpsUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
2
|
+
import { FolderPermissionsRepository } from "../../../features/flp/FolderPermissionsRepository/index.js";
|
|
3
|
+
import type { FolderLevelPermission } from "../../../flp/flp.types.js";
|
|
4
|
+
declare class ListFlpsUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
5
|
+
private repository;
|
|
6
|
+
constructor(repository: FolderPermissionsRepository.Interface);
|
|
7
|
+
execute(params: UseCaseAbstraction.Params): Promise<FolderLevelPermission[]>;
|
|
7
8
|
}
|
|
9
|
+
export declare const ListFlpsUseCase: typeof ListFlpsUseCaseImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListFlps>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ListFlpsUseCase } from "./abstractions.js";
|
|
2
|
+
import { FolderPermissionsRepository } from "../FolderPermissionsRepository/index.js";
|
|
3
|
+
class ListFlpsUseCaseImpl {
|
|
4
|
+
constructor(repository){
|
|
5
|
+
this.repository = repository;
|
|
4
6
|
}
|
|
5
7
|
async execute(params) {
|
|
6
|
-
return this.list(params);
|
|
8
|
+
return this.repository.list(params);
|
|
7
9
|
}
|
|
8
10
|
}
|
|
9
|
-
|
|
11
|
+
const ListFlpsUseCase_ListFlpsUseCase = ListFlpsUseCase.createImplementation({
|
|
12
|
+
implementation: ListFlpsUseCaseImpl,
|
|
13
|
+
dependencies: [
|
|
14
|
+
FolderPermissionsRepository
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
export { ListFlpsUseCase_ListFlpsUseCase as ListFlpsUseCase };
|
|
10
18
|
|
|
11
19
|
//# sourceMappingURL=ListFlpsUseCase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/flp/ListFlps/ListFlpsUseCase.js","sources":["../../../../src/features/flp/ListFlps/ListFlpsUseCase.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"features/flp/ListFlps/ListFlpsUseCase.js","sources":["../../../../src/features/flp/ListFlps/ListFlpsUseCase.ts"],"sourcesContent":["import { ListFlpsUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { FolderPermissionsRepository } from \"~/features/flp/FolderPermissionsRepository/index.js\";\nimport type { FolderLevelPermission } from \"~/flp/flp.types.js\";\n\nclass ListFlpsUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private repository: FolderPermissionsRepository.Interface) {}\n\n async execute(params: UseCaseAbstraction.Params): Promise<FolderLevelPermission[]> {\n return this.repository.list(params);\n }\n}\n\nexport const ListFlpsUseCase = UseCaseAbstraction.createImplementation({\n implementation: ListFlpsUseCaseImpl,\n dependencies: [FolderPermissionsRepository]\n});\n"],"names":["ListFlpsUseCaseImpl","repository","params","ListFlpsUseCase","UseCaseAbstraction","FolderPermissionsRepository"],"mappings":";;AAIA,MAAMA;IACF,YAAoBC,UAAiD,CAAE;aAAnDA,UAAU,GAAVA;IAAoD;IAExE,MAAM,QAAQC,MAAiC,EAAoC;QAC/E,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAACA;IAChC;AACJ;AAEO,MAAMC,kCAAkBC,gBAAAA,oBAAuC,CAAC;IACnE,gBAAgBJ;IAChB,cAAc;QAACK;KAA4B;AAC/C"}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import type { FolderLevelPermission } from "../../../types.js";
|
|
2
|
-
|
|
3
|
-
where: {
|
|
4
|
-
path_startsWith?: string;
|
|
5
|
-
parentId?: string;
|
|
6
|
-
type: string;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
2
|
+
import type { ListFolderPermissionsParams } from "../../../features/flp/FolderPermissionsRepository/abstractions.js";
|
|
9
3
|
export interface IListFlps {
|
|
10
|
-
execute: (params:
|
|
4
|
+
execute: (params: ListFolderPermissionsParams) => Promise<FolderLevelPermission[]>;
|
|
11
5
|
}
|
|
12
6
|
/** List folder-level permissions. */
|
|
13
7
|
export declare const ListFlpsUseCase: import("@webiny/di").Abstraction<IListFlps>;
|
|
14
8
|
export declare namespace ListFlpsUseCase {
|
|
15
9
|
type Interface = IListFlps;
|
|
10
|
+
type Params = ListFolderPermissionsParams;
|
|
16
11
|
}
|
|
17
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/flp/ListFlps/abstractions.js","sources":["../../../../src/features/flp/ListFlps/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { FolderLevelPermission } from \"~/types.js\";\
|
|
1
|
+
{"version":3,"file":"features/flp/ListFlps/abstractions.js","sources":["../../../../src/features/flp/ListFlps/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { FolderLevelPermission } from \"~/types.js\";\nimport type { ListFolderPermissionsParams } from \"~/features/flp/FolderPermissionsRepository/abstractions.js\";\n\nexport interface IListFlps {\n execute: (params: ListFolderPermissionsParams) => Promise<FolderLevelPermission[]>;\n}\n\n/** List folder-level permissions. */\nexport const ListFlpsUseCase = createAbstraction<IListFlps>(\"ListFlpsUseCase\");\n\nexport namespace ListFlpsUseCase {\n export type Interface = IListFlps;\n export type Params = ListFolderPermissionsParams;\n}\n"],"names":["ListFlpsUseCase","createAbstraction"],"mappings":";AASO,MAAMA,kBAAkBC,kBAA6B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ListFlpsUseCase } from "../abstractions.js";
|
|
2
|
+
import { CodeFlpsProvider } from "../../../../features/flp/shared/index.js";
|
|
3
|
+
import type { FolderLevelPermission } from "../../../../flp/flp.types.js";
|
|
4
|
+
declare class ListFlpsWithCodeFlpsImpl implements ListFlpsUseCase.Interface {
|
|
5
|
+
private codeFlpsProvider;
|
|
6
|
+
private decoratee;
|
|
7
|
+
constructor(codeFlpsProvider: CodeFlpsProvider.Interface, decoratee: ListFlpsUseCase.Interface);
|
|
8
|
+
execute(params: ListFlpsUseCase.Params): Promise<FolderLevelPermission[]>;
|
|
9
|
+
}
|
|
10
|
+
export declare const ListFlpsWithCodeFlps: typeof ListFlpsWithCodeFlpsImpl & {
|
|
11
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions.js").IListFlps>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ListFlpsUseCase } from "../abstractions.js";
|
|
2
|
+
import { CodeFlpMerger, CodeFlpsProvider } from "../../shared/index.js";
|
|
3
|
+
class ListFlpsWithCodeFlpsImpl {
|
|
4
|
+
constructor(codeFlpsProvider, decoratee){
|
|
5
|
+
this.codeFlpsProvider = codeFlpsProvider;
|
|
6
|
+
this.decoratee = decoratee;
|
|
7
|
+
}
|
|
8
|
+
async execute(params) {
|
|
9
|
+
const flps = await this.decoratee.execute(params);
|
|
10
|
+
return Promise.all(flps.map(async (flp)=>{
|
|
11
|
+
const codePermissions = await this.codeFlpsProvider.getPermissions({
|
|
12
|
+
type: flp.type,
|
|
13
|
+
path: flp.path
|
|
14
|
+
});
|
|
15
|
+
return CodeFlpMerger.merge(flp, codePermissions);
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const ListFlpsWithCodeFlps = ListFlpsUseCase.createDecorator({
|
|
20
|
+
decorator: ListFlpsWithCodeFlpsImpl,
|
|
21
|
+
dependencies: [
|
|
22
|
+
CodeFlpsProvider
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
export { ListFlpsWithCodeFlps };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=ListFlpsWithCodeFlps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.js","sources":["../../../../../src/features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.ts"],"sourcesContent":["import { ListFlpsUseCase } from \"../abstractions.js\";\nimport { CodeFlpMerger, CodeFlpsProvider } from \"~/features/flp/shared/index.js\";\nimport type { FolderLevelPermission } from \"~/flp/flp.types.js\";\n\nclass ListFlpsWithCodeFlpsImpl implements ListFlpsUseCase.Interface {\n constructor(\n private codeFlpsProvider: CodeFlpsProvider.Interface,\n private decoratee: ListFlpsUseCase.Interface\n ) {}\n\n async execute(params: ListFlpsUseCase.Params): Promise<FolderLevelPermission[]> {\n const flps = await this.decoratee.execute(params);\n\n return Promise.all(\n flps.map(async flp => {\n const codePermissions = await this.codeFlpsProvider.getPermissions({\n type: flp.type,\n path: flp.path\n });\n\n return CodeFlpMerger.merge(flp, codePermissions);\n })\n );\n }\n}\n\nexport const ListFlpsWithCodeFlps = ListFlpsUseCase.createDecorator({\n decorator: ListFlpsWithCodeFlpsImpl,\n dependencies: [CodeFlpsProvider]\n});\n"],"names":["ListFlpsWithCodeFlpsImpl","codeFlpsProvider","decoratee","params","flps","Promise","flp","codePermissions","CodeFlpMerger","ListFlpsWithCodeFlps","ListFlpsUseCase","CodeFlpsProvider"],"mappings":";;AAIA,MAAMA;IACF,YACYC,gBAA4C,EAC5CC,SAAoC,CAC9C;aAFUD,gBAAgB,GAAhBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,QAAQC,MAA8B,EAAoC;QAC5E,MAAMC,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACD;QAE1C,OAAOE,QAAQ,GAAG,CACdD,KAAK,GAAG,CAAC,OAAME;YACX,MAAMC,kBAAkB,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC;gBAC/D,MAAMD,IAAI,IAAI;gBACd,MAAMA,IAAI,IAAI;YAClB;YAEA,OAAOE,cAAc,KAAK,CAACF,KAAKC;QACpC;IAER;AACJ;AAEO,MAAME,uBAAuBC,gBAAgB,eAAe,CAAC;IAChE,WAAWV;IACX,cAAc;QAACW;KAAiB;AACpC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api";
|
|
2
2
|
import { ListFlpsUseCase } from "./ListFlpsUseCase.js";
|
|
3
|
-
import { ListFlpsUseCase as external_abstractions_js_ListFlpsUseCase } from "./abstractions.js";
|
|
4
|
-
import { AcoFlpCrud } from "../../folder/shared/abstractions.js";
|
|
5
3
|
const ListFlpsFeature = createFeature({
|
|
6
4
|
name: "ListFlpsFeature",
|
|
7
5
|
register (container) {
|
|
8
|
-
container.
|
|
6
|
+
container.register(ListFlpsUseCase);
|
|
9
7
|
}
|
|
10
8
|
});
|
|
11
9
|
export { ListFlpsFeature };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/flp/ListFlps/feature.js","sources":["../../../../src/features/flp/ListFlps/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListFlpsUseCase } from \"./ListFlpsUseCase.js\";\
|
|
1
|
+
{"version":3,"file":"features/flp/ListFlps/feature.js","sources":["../../../../src/features/flp/ListFlps/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListFlpsUseCase } from \"./ListFlpsUseCase.js\";\n\nexport const ListFlpsFeature = createFeature({\n name: \"ListFlpsFeature\",\n register(container) {\n container.register(ListFlpsUseCase);\n }\n});\n"],"names":["ListFlpsFeature","createFeature","container","ListFlpsUseCase"],"mappings":";;AAGO,MAAMA,kBAAkBC,cAAc;IACzC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GetLatestRevisionByEntryIdUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetLatestRevisionByEntryId/index.js";
|
|
2
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/abstractions.js";
|
|
3
|
+
import { GetUserEntryAccessUseCase as UseCaseAbstraction, GetUserFolderAccessUseCase } from "./abstractions.js";
|
|
4
|
+
declare class GetUserEntryAccessUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
5
|
+
private identityContext;
|
|
6
|
+
private getLatestRevision;
|
|
7
|
+
private getUserFolderAccess;
|
|
8
|
+
constructor(identityContext: IdentityContext.Interface, getLatestRevision: GetLatestRevisionByEntryIdUseCase.Interface, getUserFolderAccess: GetUserFolderAccessUseCase.Interface);
|
|
9
|
+
execute({ userId, model, entryId }: UseCaseAbstraction.Params): UseCaseAbstraction.Return;
|
|
10
|
+
}
|
|
11
|
+
export declare const GetUserEntryAccessUseCase: typeof GetUserEntryAccessUseCaseImpl & {
|
|
12
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetUserEntryAccessUseCase>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { GetLatestRevisionByEntryIdUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetLatestRevisionByEntryId/index.js";
|
|
3
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/abstractions.js";
|
|
4
|
+
import { NotAuthorizedError } from "@webiny/api-core/features/security/shared/errors.js";
|
|
5
|
+
import { GetUserEntryAccessUseCase, GetUserFolderAccessUseCase } from "./abstractions.js";
|
|
6
|
+
import { mayAskAboutUser } from "./mayAskAboutUser.js";
|
|
7
|
+
class GetUserEntryAccessUseCaseImpl {
|
|
8
|
+
constructor(identityContext, getLatestRevision, getUserFolderAccess){
|
|
9
|
+
this.identityContext = identityContext;
|
|
10
|
+
this.getLatestRevision = getLatestRevision;
|
|
11
|
+
this.getUserFolderAccess = getUserFolderAccess;
|
|
12
|
+
}
|
|
13
|
+
async execute({ userId, model, entryId }) {
|
|
14
|
+
if (!await mayAskAboutUser(this.identityContext, userId)) return Result.fail(new NotAuthorizedError());
|
|
15
|
+
const result = await this.identityContext.withoutAuthorization(()=>this.getLatestRevision.execute(model, {
|
|
16
|
+
id: entryId
|
|
17
|
+
}));
|
|
18
|
+
if (result.isFail()) return Result.fail(result.error);
|
|
19
|
+
const folderId = result.value.location?.folderId ?? null;
|
|
20
|
+
return this.getUserFolderAccess.execute({
|
|
21
|
+
userId,
|
|
22
|
+
folderId
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const GetUserEntryAccessUseCase_GetUserEntryAccessUseCase = GetUserEntryAccessUseCase.createImplementation({
|
|
27
|
+
implementation: GetUserEntryAccessUseCaseImpl,
|
|
28
|
+
dependencies: [
|
|
29
|
+
IdentityContext,
|
|
30
|
+
GetLatestRevisionByEntryIdUseCase,
|
|
31
|
+
GetUserFolderAccessUseCase
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
export { GetUserEntryAccessUseCase_GetUserEntryAccessUseCase as GetUserEntryAccessUseCase };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=GetUserEntryAccessUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/flp/ListFolderAccess/GetUserEntryAccessUseCase.js","sources":["../../../../src/features/flp/ListFolderAccess/GetUserEntryAccessUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { GetLatestRevisionByEntryIdUseCase } from \"@webiny/api-headless-cms/features/contentEntry/GetLatestRevisionByEntryId/index.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/abstractions.js\";\nimport { NotAuthorizedError } from \"@webiny/api-core/features/security/shared/errors.js\";\nimport {\n GetUserEntryAccessUseCase as UseCaseAbstraction,\n GetUserFolderAccessUseCase\n} from \"./abstractions.js\";\nimport { mayAskAboutUser } from \"./mayAskAboutUser.js\";\n\nclass GetUserEntryAccessUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private identityContext: IdentityContext.Interface,\n private getLatestRevision: GetLatestRevisionByEntryIdUseCase.Interface,\n private getUserFolderAccess: GetUserFolderAccessUseCase.Interface\n ) {}\n\n async execute({\n userId,\n model,\n entryId\n }: UseCaseAbstraction.Params): UseCaseAbstraction.Return {\n // Checked before reading the entry, so a refused caller learns nothing about it.\n if (!(await mayAskAboutUser(this.identityContext, userId))) {\n return Result.fail(new NotAuthorizedError());\n }\n // The entry is read whoever asks: the answer is about the user, not the caller.\n const result = await this.identityContext.withoutAuthorization(() =>\n this.getLatestRevision.execute(model, { id: entryId })\n );\n if (result.isFail()) {\n return Result.fail(result.error);\n }\n const folderId = result.value.location?.folderId ?? null;\n return this.getUserFolderAccess.execute({ userId, folderId });\n }\n}\n\nexport const GetUserEntryAccessUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetUserEntryAccessUseCaseImpl,\n dependencies: [IdentityContext, GetLatestRevisionByEntryIdUseCase, GetUserFolderAccessUseCase]\n});\n"],"names":["GetUserEntryAccessUseCaseImpl","identityContext","getLatestRevision","getUserFolderAccess","userId","model","entryId","mayAskAboutUser","Result","NotAuthorizedError","result","folderId","GetUserEntryAccessUseCase","UseCaseAbstraction","IdentityContext","GetLatestRevisionByEntryIdUseCase","GetUserFolderAccessUseCase"],"mappings":";;;;;;AAUA,MAAMA;IACF,YACYC,eAA0C,EAC1CC,iBAA8D,EAC9DC,mBAAyD,CACnE;aAHUF,eAAe,GAAfA;aACAC,iBAAiB,GAAjBA;aACAC,mBAAmB,GAAnBA;IACT;IAEH,MAAM,QAAQ,EACVC,MAAM,EACNC,KAAK,EACLC,OAAO,EACiB,EAA6B;QAErD,IAAI,CAAE,MAAMC,gBAAgB,IAAI,CAAC,eAAe,EAAEH,SAC9C,OAAOI,OAAO,IAAI,CAAC,IAAIC;QAG3B,MAAMC,SAAS,MAAM,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,IAC3D,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAACL,OAAO;gBAAE,IAAIC;YAAQ;QAExD,IAAII,OAAO,MAAM,IACb,OAAOF,OAAO,IAAI,CAACE,OAAO,KAAK;QAEnC,MAAMC,WAAWD,OAAO,KAAK,CAAC,QAAQ,EAAE,YAAY;QACpD,OAAO,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC;YAAEN;YAAQO;QAAS;IAC/D;AACJ;AAEO,MAAMC,sDAA4BC,0BAAAA,oBAAuC,CAAC;IAC7E,gBAAgBb;IAChB,cAAc;QAACc;QAAiBC;QAAmCC;KAA2B;AAClG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FeatureFlags } from "@webiny/api-core/features/featureFlags/abstractions.js";
|
|
2
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/abstractions.js";
|
|
3
|
+
import { GetUserUseCase } from "@webiny/api-core/features/users/GetUser/index.js";
|
|
4
|
+
import { ListTeamsUseCase } from "@webiny/api-core/features/security/teams/ListTeams/index.js";
|
|
5
|
+
import { ListRolesUseCase } from "@webiny/api-core/features/security/roles/ListRoles/index.js";
|
|
6
|
+
import { GetUserFolderAccessUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
7
|
+
import { GetFlpUseCase } from "../../../features/flp/GetFlp/abstractions.js";
|
|
8
|
+
/**
|
|
9
|
+
* One folder's permissions (`GetFlpUseCase`, inherited and code-defined ones included) checked with
|
|
10
|
+
* one user's level (see `getUserFolderLevel`), as `ListFolderAccessUseCase` does for every user.
|
|
11
|
+
*/
|
|
12
|
+
declare class GetUserFolderAccessUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
13
|
+
private featureFlags;
|
|
14
|
+
private identityContext;
|
|
15
|
+
private getFlp;
|
|
16
|
+
private getUser;
|
|
17
|
+
private listTeams;
|
|
18
|
+
private listRoles;
|
|
19
|
+
constructor(featureFlags: FeatureFlags.Interface, identityContext: IdentityContext.Interface, getFlp: GetFlpUseCase.Interface, getUser: GetUserUseCase.Interface, listTeams: ListTeamsUseCase.Interface, listRoles: ListRolesUseCase.Interface);
|
|
20
|
+
execute({ userId, folderId }: UseCaseAbstraction.Params): UseCaseAbstraction.Return;
|
|
21
|
+
}
|
|
22
|
+
export declare const GetUserFolderAccessUseCase: typeof GetUserFolderAccessUseCaseImpl & {
|
|
23
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetUserFolderAccessUseCase>;
|
|
24
|
+
};
|
|
25
|
+
export {};
|