diff --git a/src/Controller/Adm/AudioFileController.php b/src/Controller/Adm/AudioFileController.php index f724465f..f0b236d7 100644 --- a/src/Controller/Adm/AudioFileController.php +++ b/src/Controller/Adm/AudioFileController.php @@ -24,7 +24,7 @@ final class AudioFileController extends AbstractAssetFileController #[OAParameterPath('audio')] public function download(AudioFile $audio): Response { - $this->denyAccessUnlessGranted(DamPermissions::DAM_AUDIO_VIEW, $audio); + $this->denyAccessUnlessGranted(DamPermissions::DAM_AUDIO_READ, $audio); return $this->getDownloadResponse($audio); } diff --git a/src/Controller/Adm/DocumentFileController.php b/src/Controller/Adm/DocumentFileController.php index 5c76433a..a0d336f5 100644 --- a/src/Controller/Adm/DocumentFileController.php +++ b/src/Controller/Adm/DocumentFileController.php @@ -24,7 +24,7 @@ final class DocumentFileController extends AbstractAssetFileController #[OAParameterPath('document')] public function download(DocumentFile $document): Response { - $this->denyAccessUnlessGranted(DamPermissions::DAM_DOCUMENT_VIEW, $document); + $this->denyAccessUnlessGranted(DamPermissions::DAM_DOCUMENT_READ, $document); return $this->getDownloadResponse($document); } diff --git a/src/Controller/Adm/ImageFileController.php b/src/Controller/Adm/ImageFileController.php index fe6c0180..60e2d9cc 100644 --- a/src/Controller/Adm/ImageFileController.php +++ b/src/Controller/Adm/ImageFileController.php @@ -24,7 +24,7 @@ final class ImageFileController extends AbstractAssetFileController #[OAParameterPath('image')] public function download(ImageFile $image): Response { - $this->denyAccessUnlessGranted(DamPermissions::DAM_IMAGE_VIEW, $image); + $this->denyAccessUnlessGranted(DamPermissions::DAM_IMAGE_READ, $image); return $this->getDownloadResponse($image); } diff --git a/src/Controller/Adm/VideoFileController.php b/src/Controller/Adm/VideoFileController.php index 1643b618..64a760fd 100644 --- a/src/Controller/Adm/VideoFileController.php +++ b/src/Controller/Adm/VideoFileController.php @@ -24,7 +24,7 @@ final class VideoFileController extends AbstractAssetFileController #[OAParameterPath('video')] public function download(VideoFile $video): Response { - $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_VIEW, $video); + $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_READ, $video); return $this->getDownloadResponse($video); } diff --git a/src/Controller/Api/Adm/V1/AssetController.php b/src/Controller/Api/Adm/V1/AssetController.php index ec11a5ba..fa26074b 100644 --- a/src/Controller/Api/Adm/V1/AssetController.php +++ b/src/Controller/Api/Adm/V1/AssetController.php @@ -87,7 +87,7 @@ public function create(#[SerializeParam] AssetAdmCreateDto $assetDto, AssetLicen public function searchByLicence(AssetLicence $assetLicence, #[SerializeParam] AssetAdmSearchLicenceCollectionDto $searchDto): JsonResponse { App::throwOnReadOnlyMode(); - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $assetLicence); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $assetLicence); $searchDto->setLicences(new ArrayCollection([$assetLicence])); return $this->okResponse( @@ -106,7 +106,7 @@ public function searchByLicence(AssetLicence $assetLicence, #[SerializeParam] As public function search(#[SerializeParam] AssetAdmSearchLicenceCollectionDto $searchDto): JsonResponse { App::throwOnReadOnlyMode(); - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $searchDto); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $searchDto); return $this->okResponse( $this->elasticSearch->searchInfiniteList($searchDto) @@ -122,7 +122,7 @@ public function search(#[SerializeParam] AssetAdmSearchLicenceCollectionDto $sea #[OAParameterPath('search', description: 'Searched asset.'), OAResponse([AssetAdmListDto::class])] public function searchByExtSystem(ExtSystem $extSystem, #[SerializeParam] AssetAdmSearchDto $searchDto): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $extSystem); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $extSystem); return $this->okResponse( $this->elasticSearch->searchInfiniteListByExtSystem($searchDto, $extSystem) @@ -135,7 +135,7 @@ public function getByLicenceAndIds( #[ArrayStringParam(itemsLimit: self::IDS_LIMIT)] array $ids, ): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $assetLicence); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $assetLicence); return $this->okResponse( $this->admRepositoryDecorator->findByLicenceAndIds($assetLicence, $ids) @@ -148,7 +148,7 @@ public function getByExtSystemAndIds( #[ArrayStringParam(itemsLimit: self::IDS_LIMIT, itemNormalizer: 'intval')] array $ids, ): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $extSystem); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $extSystem); return $this->okResponse( $this->admRepositoryDecorator->findByExtSystemAndIds($extSystem, $ids) @@ -162,7 +162,7 @@ public function getByExtSystemAndIds( #[OAResponse(AssetAdmDetailDto::class)] public function getOne(Asset $asset): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $asset); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $asset); return $this->okResponse(AssetAdmDetailDto::getInstance($asset)); } @@ -174,7 +174,7 @@ public function getOne(Asset $asset): JsonResponse #[OAResponse(AssetAdmDetailDto::class)] public function getOneByAssetFile(AssetFile $assetFile): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $assetFile->getAsset()); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $assetFile->getAsset()); return $this->okResponse(AssetAdmDetailDto::getInstance($assetFile->getAsset())); } diff --git a/src/Controller/Api/Adm/V1/AssetCustomFormController.php b/src/Controller/Api/Adm/V1/AssetCustomFormController.php index b313f9cc..3a30f0ef 100644 --- a/src/Controller/Api/Adm/V1/AssetCustomFormController.php +++ b/src/Controller/Api/Adm/V1/AssetCustomFormController.php @@ -51,7 +51,7 @@ public function __construct( public function getOne(ExtSystem $extSystem, AssetType $assetType): JsonResponse { $form = $this->assetCustomFormRepository->findOneByTypeAndExtSystem($extSystem, $assetType); - $this->denyAccessUnlessGranted(DamPermissions::DAM_CUSTOM_FORM_VIEW, $form); + $this->denyAccessUnlessGranted(DamPermissions::DAM_CUSTOM_FORM_READ, $form); return $form ? $this->okResponse($form) @@ -68,7 +68,7 @@ public function getElements(ExtSystem $extSystem, AssetType $assetType, ApiParam { $this->denyAccessUnlessGranted(DamPermissions::DAM_CUSTOM_FORM_ELEMENT_VIEW); $form = $this->assetCustomFormRepository->findOneByTypeAndExtSystem($extSystem, $assetType); - $this->denyAccessUnlessGranted(DamPermissions::DAM_CUSTOM_FORM_VIEW, $form); + $this->denyAccessUnlessGranted(DamPermissions::DAM_CUSTOM_FORM_READ, $form); if (null === $form) { return $this->okResponse(new ApiResponseList()); diff --git a/src/Controller/Api/Adm/V1/AssetLicenceController.php b/src/Controller/Api/Adm/V1/AssetLicenceController.php index 167507fe..8fd1ee7c 100644 --- a/src/Controller/Api/Adm/V1/AssetLicenceController.php +++ b/src/Controller/Api/Adm/V1/AssetLicenceController.php @@ -43,7 +43,7 @@ public function __construct( #[OAParameterPath('assetLicence'), OAResponse(AssetLicence::class)] public function getOne(AssetLicence $assetLicence): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_LICENCE_VIEW, $assetLicence); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_LICENCE_READ, $assetLicence); return $this->okResponse($assetLicence); } diff --git a/src/Controller/Api/Adm/V1/AssetLicenceGroupController.php b/src/Controller/Api/Adm/V1/AssetLicenceGroupController.php index 806b22b7..890126b1 100644 --- a/src/Controller/Api/Adm/V1/AssetLicenceGroupController.php +++ b/src/Controller/Api/Adm/V1/AssetLicenceGroupController.php @@ -43,7 +43,7 @@ public function __construct( #[OAParameterPath('assetLicenceGroup'), OAResponse(AssetLicenceGroup::class)] public function getOne(AssetLicenceGroup $assetLicenceGroup): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_LICENCE_GROUP_VIEW, $assetLicenceGroup); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_LICENCE_GROUP_READ, $assetLicenceGroup); return $this->okResponse($assetLicenceGroup); } diff --git a/src/Controller/Api/Adm/V1/AssetSlotController.php b/src/Controller/Api/Adm/V1/AssetSlotController.php index 904e5768..e038b0df 100644 --- a/src/Controller/Api/Adm/V1/AssetSlotController.php +++ b/src/Controller/Api/Adm/V1/AssetSlotController.php @@ -38,7 +38,7 @@ public function __construct( #[OAParameterPath('asset'), OAResponse(AssetSlotAdmListDecorator::class), OAResponseValidation] public function list(Asset $asset): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $asset); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $asset); return $this->okResponse($this->assetSlotFacade->decorateAssetSlots($asset)); } diff --git a/src/Controller/Api/Adm/V1/AudioController.php b/src/Controller/Api/Adm/V1/AudioController.php index 392ba5b2..dec958eb 100644 --- a/src/Controller/Api/Adm/V1/AudioController.php +++ b/src/Controller/Api/Adm/V1/AudioController.php @@ -191,7 +191,7 @@ public function addChunk(AudioFile $audio, ChunkAdmCreateDto $chunk): JsonRespon #[OAResponse(AudioFileAdmDetailDto::class)] public function getOne(AudioFile $audio): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_AUDIO_VIEW, $audio); + $this->denyAccessUnlessGranted(DamPermissions::DAM_AUDIO_READ, $audio); return $this->okResponse(AudioFileAdmDetailDto::getInstance($audio)); } @@ -236,7 +236,7 @@ public function delete(AudioFile $audio): JsonResponse #[OAParameterPath('audio'), OAResponseValidation] public function generateDownloadUrl(AudioFile $audio): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_AUDIO_VIEW, $audio); + $this->denyAccessUnlessGranted(DamPermissions::DAM_AUDIO_READ, $audio); return $this->okResponse( $this->assetFileDownloadFacade->decorateDownloadLink($audio) diff --git a/src/Controller/Api/Adm/V1/AuthorController.php b/src/Controller/Api/Adm/V1/AuthorController.php index 0c25ed04..df4073c1 100644 --- a/src/Controller/Api/Adm/V1/AuthorController.php +++ b/src/Controller/Api/Adm/V1/AuthorController.php @@ -43,7 +43,7 @@ public function __construct( #[OAParameterPath('author'), OAResponse(Author::class)] public function getOne(Author $author): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_AUTHOR_VIEW, $author); + $this->denyAccessUnlessGranted(DamPermissions::DAM_AUTHOR_READ, $author); return $this->okResponse($author); } @@ -55,7 +55,7 @@ public function getOne(Author $author): JsonResponse #[OAParameterPath('search', description: 'Searched.'), OAResponse([Author::class])] public function searchByExtSystem(ExtSystem $extSystem, #[SerializeParam] AuthorAdmSearchDto $searchDto): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_AUTHOR_VIEW, $extSystem); + $this->denyAccessUnlessGranted(DamPermissions::DAM_AUTHOR_READ, $extSystem); return $this->okResponse($this->elasticSearch->searchInfiniteList($searchDto, $extSystem)); } diff --git a/src/Controller/Api/Adm/V1/ConfigurationController.php b/src/Controller/Api/Adm/V1/ConfigurationController.php index e0897879..4bdcd1ff 100644 --- a/src/Controller/Api/Adm/V1/ConfigurationController.php +++ b/src/Controller/Api/Adm/V1/ConfigurationController.php @@ -48,7 +48,7 @@ public function get(): JsonResponse #[OAResponse(ExtSystemAdmGetDecorator::class)] public function getExtSystem(ExtSystem $extSystem): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_EXT_SYSTEM_VIEW, $extSystem); + $this->denyAccessUnlessGranted(DamPermissions::DAM_EXT_SYSTEM_READ, $extSystem); return $this->okResponse( $this->configurationFacade->decorateExtSystemAdm($extSystem), diff --git a/src/Controller/Api/Adm/V1/CustomDistributionController.php b/src/Controller/Api/Adm/V1/CustomDistributionController.php index c5ab253a..eb0a9108 100644 --- a/src/Controller/Api/Adm/V1/CustomDistributionController.php +++ b/src/Controller/Api/Adm/V1/CustomDistributionController.php @@ -81,7 +81,7 @@ public function delete(Distribution $distribution): JsonResponse public function redistribute(Distribution $distribution, #[SerializeParam] CustomDistributionAdmDto $customDistribution): JsonResponse { App::throwOnReadOnlyMode(); - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $this->assetRepository->find($distribution->getAssetId())); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $this->assetRepository->find($distribution->getAssetId())); $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_ACCESS, $distribution->getDistributionService()); return $this->okResponse( @@ -98,7 +98,7 @@ public function redistribute(Distribution $distribution, #[SerializeParam] Custo #[OAParameterPath('assetFile'), OAParameterPath('distributionService'), OAResponse(CustomDistributionAdmDto::class)] public function preparePayload(AssetFile $assetFile, string $distributionService): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $assetFile); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $assetFile); $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_ACCESS, $distributionService); return $this->okResponse( diff --git a/src/Controller/Api/Adm/V1/DistributionCategoryController.php b/src/Controller/Api/Adm/V1/DistributionCategoryController.php index ed299e84..c6bf2b57 100644 --- a/src/Controller/Api/Adm/V1/DistributionCategoryController.php +++ b/src/Controller/Api/Adm/V1/DistributionCategoryController.php @@ -43,7 +43,7 @@ public function __construct( #[OAParameterPath('distributionCategory'), OAResponse(DistributionCategory::class)] public function getOne(DistributionCategory $distributionCategory): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_CATEGORY_VIEW, $distributionCategory); + $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_CATEGORY_READ, $distributionCategory); return $this->okResponse($distributionCategory); } @@ -57,7 +57,7 @@ public function getOne(DistributionCategory $distributionCategory): JsonResponse #[OAParameterPath('extSystem'), OAParameterPath('type'), OAResponse([DistributionCategory::class])] public function getList(ApiParams $apiParams, ExtSystem $extSystem): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_CATEGORY_VIEW, $extSystem); + $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_CATEGORY_READ, $extSystem); return $this->okResponse( $this->distributionCategoryAdmRepositoryDecorator->findByApiParams( diff --git a/src/Controller/Api/Adm/V1/DistributionCategorySelectController.php b/src/Controller/Api/Adm/V1/DistributionCategorySelectController.php index e9d09b72..68cb092d 100644 --- a/src/Controller/Api/Adm/V1/DistributionCategorySelectController.php +++ b/src/Controller/Api/Adm/V1/DistributionCategorySelectController.php @@ -43,7 +43,7 @@ public function __construct( #[OAParameterPath('distributionCategorySelect'), OAResponse(DistributionCategorySelect::class)] public function getOne(DistributionCategorySelect $distributionCategorySelect): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_CATEGORY_SELECT_VIEW, $distributionCategorySelect); + $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_CATEGORY_SELECT_READ, $distributionCategorySelect); return $this->okResponse($distributionCategorySelect); } @@ -58,7 +58,7 @@ public function getOne(DistributionCategorySelect $distributionCategorySelect): #[OAParameterPath('extSystem'), OAParameterPath('assetType'), OAResponse([DistributionCategorySelect::class])] public function getList(ApiParams $apiParams, ExtSystem $extSystem, AssetType $assetType = null): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_CATEGORY_SELECT_VIEW, $extSystem); + $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_CATEGORY_SELECT_READ, $extSystem); return $this->okResponse( $this->distributionCategorySelectAdmRepoDecorator->findByApiParams( diff --git a/src/Controller/Api/Adm/V1/DistributionController.php b/src/Controller/Api/Adm/V1/DistributionController.php index f2d134cf..8fc8e238 100644 --- a/src/Controller/Api/Adm/V1/DistributionController.php +++ b/src/Controller/Api/Adm/V1/DistributionController.php @@ -69,7 +69,7 @@ public function getOne(Distribution $distribution): JsonResponse #[OAParameterPath('assetFile'), OAResponse([Distribution::class])] public function getAssetDistributionList(Asset $asset, ApiParams $apiParams): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $asset); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $asset); return $this->okResponse( $this->distributionRepository->findByApiParamsByAsset($apiParams, $asset) @@ -83,7 +83,7 @@ public function getAssetDistributionList(Asset $asset, ApiParams $apiParams): Js #[OAParameterPath('assetFile'), OAResponse([Distribution::class])] public function getAssetFileDistributionList(AssetFile $assetFile, ApiParams $apiParams): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $assetFile); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $assetFile); return $this->okResponse( $this->distributionRepository->findByApiParamsByAssetFile($apiParams, $assetFile) diff --git a/src/Controller/Api/Adm/V1/DocumentController.php b/src/Controller/Api/Adm/V1/DocumentController.php index 37ef6a5d..cec95fc2 100644 --- a/src/Controller/Api/Adm/V1/DocumentController.php +++ b/src/Controller/Api/Adm/V1/DocumentController.php @@ -190,7 +190,7 @@ public function addChunk(DocumentFile $document, ChunkAdmCreateDto $chunk): Json #[OAResponse(DocumentFileAdmDetailDto::class)] public function getOne(DocumentFile $document): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_DOCUMENT_VIEW, $document); + $this->denyAccessUnlessGranted(DamPermissions::DAM_DOCUMENT_READ, $document); return $this->okResponse(DocumentFileAdmDetailDto::getInstance($document)); } @@ -235,7 +235,7 @@ public function delete(DocumentFile $document): JsonResponse #[OAParameterPath('document'), OAResponseValidation] public function generateDownloadUrl(DocumentFile $document): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_DOCUMENT_VIEW, $document); + $this->denyAccessUnlessGranted(DamPermissions::DAM_DOCUMENT_READ, $document); return $this->okResponse( $this->assetFileDownloadFacade->decorateDownloadLink($document) diff --git a/src/Controller/Api/Adm/V1/ExtSystemController.php b/src/Controller/Api/Adm/V1/ExtSystemController.php index e2047d83..cf329916 100644 --- a/src/Controller/Api/Adm/V1/ExtSystemController.php +++ b/src/Controller/Api/Adm/V1/ExtSystemController.php @@ -42,7 +42,7 @@ public function __construct( #[OAParameterPath('extSystem'), OAResponse(ExtSystem::class)] public function getOne(ExtSystem $extSystem): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_EXT_SYSTEM_VIEW, $extSystem); + $this->denyAccessUnlessGranted(DamPermissions::DAM_EXT_SYSTEM_READ, $extSystem); return $this->okResponse($extSystem); } diff --git a/src/Controller/Api/Adm/V1/ImageController.php b/src/Controller/Api/Adm/V1/ImageController.php index a0430869..9338f97d 100644 --- a/src/Controller/Api/Adm/V1/ImageController.php +++ b/src/Controller/Api/Adm/V1/ImageController.php @@ -190,7 +190,7 @@ public function addChunk(ImageFile $image, ChunkAdmCreateDto $chunk): JsonRespon #[OAResponse(ImageFileAdmDetailDto::class)] public function getOne(ImageFile $image): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_IMAGE_VIEW, $image); + $this->denyAccessUnlessGranted(DamPermissions::DAM_IMAGE_READ, $image); return $this->okResponse(ImageFileAdmDetailDto::getInstance($image)); } @@ -266,7 +266,7 @@ public function delete(ImageFile $image): JsonResponse #[OAParameterPath('image'), OAResponseValidation] public function generateDownloadUrl(ImageFile $image): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_IMAGE_VIEW, $image); + $this->denyAccessUnlessGranted(DamPermissions::DAM_IMAGE_READ, $image); return $this->okResponse( $this->assetFileDownloadFacade->decorateDownloadLink($image) diff --git a/src/Controller/Api/Adm/V1/JwDistributionController.php b/src/Controller/Api/Adm/V1/JwDistributionController.php index 50e81744..5fb2531f 100644 --- a/src/Controller/Api/Adm/V1/JwDistributionController.php +++ b/src/Controller/Api/Adm/V1/JwDistributionController.php @@ -62,7 +62,7 @@ public function distribute(AssetFile $assetFile, #[SerializeParam] JwDistributio public function redistribute(JwDistribution $distribution, #[SerializeParam] JwDistribution $newDistribution): JsonResponse { App::throwOnReadOnlyMode(); - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $this->assetRepository->find($distribution->getAssetId())); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $this->assetRepository->find($distribution->getAssetId())); $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_ACCESS, $distribution->getDistributionService()); return $this->okResponse( diff --git a/src/Controller/Api/Adm/V1/KeywordController.php b/src/Controller/Api/Adm/V1/KeywordController.php index 5290bdda..2f303729 100644 --- a/src/Controller/Api/Adm/V1/KeywordController.php +++ b/src/Controller/Api/Adm/V1/KeywordController.php @@ -44,7 +44,7 @@ public function __construct( #[OAParameterPath('keyword'), OAResponse(Keyword::class)] public function getOne(Keyword $keyword): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_KEYWORD_VIEW, $keyword); + $this->denyAccessUnlessGranted(DamPermissions::DAM_KEYWORD_READ, $keyword); return $this->okResponse($keyword); } @@ -56,7 +56,7 @@ public function getOne(Keyword $keyword): JsonResponse #[OAParameterPath('search', description: 'Searched.'), OAResponse([Keyword::class])] public function searchByExtSystem(ExtSystem $extSystem, #[SerializeParam] KeywordAdmSearchDto $searchDto): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_KEYWORD_VIEW, $extSystem); + $this->denyAccessUnlessGranted(DamPermissions::DAM_KEYWORD_READ, $extSystem); return $this->okResponse($this->elasticSearch->searchInfiniteList($searchDto, $extSystem)); } diff --git a/src/Controller/Api/Adm/V1/PodcastController.php b/src/Controller/Api/Adm/V1/PodcastController.php index 9d11a9ba..c5dccdfa 100644 --- a/src/Controller/Api/Adm/V1/PodcastController.php +++ b/src/Controller/Api/Adm/V1/PodcastController.php @@ -43,7 +43,7 @@ public function __construct( #[OAParameterPath('podcast'), OAResponse(Podcast::class)] public function getOne(Podcast $podcast): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_VIEW, $podcast); + $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_READ, $podcast); return $this->okResponse($podcast); } @@ -87,7 +87,7 @@ public function update(Podcast $podcast, #[SerializeParam] Podcast $newPodcast): #[OAResponseInfiniteList(Podcast::class)] public function getListByExtSystem(ApiParams $apiParams, ExtSystem $extSystem): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_VIEW, $extSystem); + $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_READ, $extSystem); return $this->okResponse($this->podcastRepository->findByApiParamsWithInfiniteListing( apiParams: LicensedEntityApiParams::applyCustomFilter($apiParams, $extSystem), @@ -102,7 +102,7 @@ public function getListByExtSystem(ApiParams $apiParams, ExtSystem $extSystem): #[OAResponseInfiniteList(Podcast::class)] public function getList(ApiParams $apiParams, AssetLicence $assetLicence): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_VIEW, $assetLicence); + $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_READ, $assetLicence); return $this->okResponse($this->podcastRepository->findByApiParamsWithInfiniteListing( apiParams: LicensedEntityApiParams::applyLicenceCustomFilter($apiParams, $assetLicence), diff --git a/src/Controller/Api/Adm/V1/PodcastEpisodeController.php b/src/Controller/Api/Adm/V1/PodcastEpisodeController.php index 7bab456e..dfe1577c 100644 --- a/src/Controller/Api/Adm/V1/PodcastEpisodeController.php +++ b/src/Controller/Api/Adm/V1/PodcastEpisodeController.php @@ -46,7 +46,7 @@ public function __construct( #[OAParameterPath('podcast'), OAResponse(Podcast::class)] public function getOne(PodcastEpisode $podcastEpisode): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_EPISODE_VIEW, $podcastEpisode); + $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_EPISODE_READ, $podcastEpisode); return $this->okResponse($podcastEpisode); } @@ -55,8 +55,8 @@ public function getOne(PodcastEpisode $podcastEpisode): JsonResponse #[OAResponse(PodcastEpisode::class)] public function preparePayload(Asset $asset, Podcast $podcast): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_VIEW, $podcast); - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $asset); + $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_READ, $podcast); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $asset); return $this->okResponse($this->episodeBodyFacade->preparePayload($asset, $podcast)); } @@ -68,7 +68,7 @@ public function preparePayload(Asset $asset, Podcast $podcast): JsonResponse #[OAResponseInfiniteList(PodcastEpisode::class)] public function getList(Podcast $podcast, ApiParams $apiParams): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_EPISODE_VIEW, $podcast); + $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_EPISODE_READ, $podcast); return $this->okResponse($this->podcastEpisodeRepository->findByApiParamsWithInfiniteListing( apiParams: PodcastEpisodeApiParams::applyCustomFilter($apiParams, $podcast), @@ -83,7 +83,7 @@ public function getList(Podcast $podcast, ApiParams $apiParams): JsonResponse #[OAResponseInfiniteList(PodcastEpisode::class)] public function getListByAsset(Asset $asset, ApiParams $apiParams): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_EPISODE_VIEW, $asset); + $this->denyAccessUnlessGranted(DamPermissions::DAM_PODCAST_EPISODE_READ, $asset); return $this->okResponse($this->podcastEpisodeRepository->findByApiParamsWithInfiniteListing( apiParams: PodcastEpisodeApiParams::applyCustomFilterByAsset($apiParams, $asset), diff --git a/src/Controller/Api/Adm/V1/RegionOfInterestController.php b/src/Controller/Api/Adm/V1/RegionOfInterestController.php index 1a9409b2..00be38f8 100644 --- a/src/Controller/Api/Adm/V1/RegionOfInterestController.php +++ b/src/Controller/Api/Adm/V1/RegionOfInterestController.php @@ -77,7 +77,7 @@ public function create(ImageFile $image, #[SerializeParam] RegionOfInterestAdmDe #[OAParameterPath('image'), OAResponse([RegionOfInterestAdmListDto::class])] public function getList(ImageFile $image, ApiParams $apiParams): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_REGION_OF_INTEREST_VIEW, $image); + $this->denyAccessUnlessGranted(DamPermissions::DAM_REGION_OF_INTEREST_READ, $image); return $this->okResponse( $this->repositoryDecorator->findByApiParamsWithInfiniteListing($apiParams, $image), @@ -91,7 +91,7 @@ public function getList(ImageFile $image, ApiParams $apiParams): JsonResponse #[OAResponse(RegionOfInterestAdmDetailDto::class)] public function getOne(RegionOfInterest $regionOfInterest): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_REGION_OF_INTEREST_VIEW, $regionOfInterest); + $this->denyAccessUnlessGranted(DamPermissions::DAM_REGION_OF_INTEREST_READ, $regionOfInterest); return $this->okResponse(RegionOfInterestAdmDetailDto::getInstance($regionOfInterest)); } diff --git a/src/Controller/Api/Adm/V1/VideoController.php b/src/Controller/Api/Adm/V1/VideoController.php index 1e1e251f..ac7abd47 100644 --- a/src/Controller/Api/Adm/V1/VideoController.php +++ b/src/Controller/Api/Adm/V1/VideoController.php @@ -143,7 +143,7 @@ public function setDistributionPreview(VideoFile $video, Distribution $distribut #[OAParameterPath('video'), OAResponse([DistributionImagePreviewAdmDto::class])] public function getDistributionImagePreviewList(VideoFile $video, ApiParams $apiParams): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_VIEW, $video); + $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_READ, $video); return $this->okResponse( $this->videoDistributionFacade->getPreview($apiParams, $video) @@ -244,7 +244,7 @@ public function addChunk(VideoFile $video, ChunkAdmCreateDto $chunk): JsonRespon #[OAResponse(VideoFileAdmDetailDto::class)] public function getOne(VideoFile $video): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_VIEW, $video); + $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_READ, $video); return $this->okResponse(VideoFileAdmDetailDto::getInstance($video)); } @@ -288,7 +288,7 @@ public function delete(VideoFile $video): JsonResponse #[OAParameterPath('video'), OAResponseValidation] public function generateDownloadUrl(VideoFile $video): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_VIEW, $video); + $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_READ, $video); return $this->okResponse( $this->assetFileDownloadFacade->decorateDownloadLink($video) diff --git a/src/Controller/Api/Adm/V1/VideoShowController.php b/src/Controller/Api/Adm/V1/VideoShowController.php index acd79221..03846e7e 100644 --- a/src/Controller/Api/Adm/V1/VideoShowController.php +++ b/src/Controller/Api/Adm/V1/VideoShowController.php @@ -44,7 +44,7 @@ public function __construct( #[OAParameterPath('videoShow'), OAResponse(VideoShow::class)] public function getOne(VideoShow $videoShow): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_VIEW, $videoShow); + $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_READ, $videoShow); return $this->okResponse($videoShow); } @@ -88,7 +88,7 @@ public function update(VideoShow $videoShow, #[SerializeParam] VideoShow $newVid #[OAResponseInfiniteList(VideoShow::class)] public function getListByExtSystem(ApiParams $apiParams, ExtSystem $extSystem): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_VIEW, $extSystem); + $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_READ, $extSystem); return $this->okResponse($this->videoShowRepository->findByApiParamsWithInfiniteListing( apiParams: LicensedEntityApiParams::applyCustomFilter($apiParams, $extSystem), @@ -103,7 +103,7 @@ public function getListByExtSystem(ApiParams $apiParams, ExtSystem $extSystem): #[OAResponseInfiniteList(VideoShow::class)] public function getListByLicence(ApiParams $apiParams, AssetLicence $assetLicence): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_VIEW, $assetLicence); + $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_READ, $assetLicence); return $this->okResponse($this->videoShowRepository->findByApiParamsWithInfiniteListing( apiParams: LicensedEntityApiParams::applyLicenceCustomFilter($apiParams, $assetLicence), diff --git a/src/Controller/Api/Adm/V1/VideoShowEpisodeController.php b/src/Controller/Api/Adm/V1/VideoShowEpisodeController.php index 0649b9c0..1c661a33 100644 --- a/src/Controller/Api/Adm/V1/VideoShowEpisodeController.php +++ b/src/Controller/Api/Adm/V1/VideoShowEpisodeController.php @@ -46,7 +46,7 @@ public function __construct( #[OAParameterPath('VideoShowEpisode'), OAResponse(VideoShowEpisode::class)] public function getOne(VideoShowEpisode $videoShowEpisode): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_EPISODE_VIEW, $videoShowEpisode); + $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_EPISODE_READ, $videoShowEpisode); return $this->okResponse($videoShowEpisode); } @@ -55,8 +55,8 @@ public function getOne(VideoShowEpisode $videoShowEpisode): JsonResponse #[OAResponse(VideoShowEpisode::class)] public function preparePayload(Asset $asset, VideoShow $videoShow): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_EPISODE_VIEW, $videoShow); - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $asset); + $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_EPISODE_READ, $videoShow); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $asset); return $this->okResponse($this->videoShowEpisodeBodyFacade->preparePayload($asset, $videoShow)); } @@ -68,7 +68,7 @@ public function preparePayload(Asset $asset, VideoShow $videoShow): JsonResponse #[OAResponseInfiniteList(VideoShowEpisode::class)] public function getList(VideoShow $videoShow, ApiParams $apiParams): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_EPISODE_VIEW, $videoShow); + $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_EPISODE_READ, $videoShow); return $this->okResponse($this->videoShowEpisodeRepository->findByApiParamsWithInfiniteListing( apiParams: VideoShowEpisodeApiParams::applyCustomFilter($apiParams, $videoShow), @@ -83,7 +83,7 @@ public function getList(VideoShow $videoShow, ApiParams $apiParams): JsonRespons #[OAResponseInfiniteList(VideoShowEpisode::class)] public function getListByAsset(Asset $asset, ApiParams $apiParams): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_EPISODE_VIEW, $asset); + $this->denyAccessUnlessGranted(DamPermissions::DAM_VIDEO_SHOW_EPISODE_READ, $asset); return $this->okResponse($this->videoShowEpisodeRepository->findByApiParamsWithInfiniteListing( apiParams: VideoShowEpisodeApiParams::applyCustomFilterByAsset($apiParams, $asset), diff --git a/src/Controller/Api/Adm/V1/YoutubeDistributionController.php b/src/Controller/Api/Adm/V1/YoutubeDistributionController.php index 551b9b49..ac097471 100644 --- a/src/Controller/Api/Adm/V1/YoutubeDistributionController.php +++ b/src/Controller/Api/Adm/V1/YoutubeDistributionController.php @@ -92,7 +92,7 @@ public function logout(string $distributionService): JsonResponse #[OAParameterPath('assetFile'), OAParameterPath('distributionService'), OAResponse(YoutubeDistribution::class)] public function preparePayload(AssetFile $assetFile, string $distributionService): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $assetFile); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $assetFile); $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_ACCESS, $distributionService); return $this->okResponse( @@ -144,7 +144,7 @@ public function getLanguage(string $distributionService): JsonResponse public function distribute(AssetFile $assetFile, #[SerializeParam] YoutubeDistribution $youtubeDistribution): JsonResponse { App::throwOnReadOnlyMode(); - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $assetFile); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $assetFile); $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_ACCESS, $youtubeDistribution->getDistributionService()); return $this->okResponse( @@ -162,7 +162,7 @@ public function distribute(AssetFile $assetFile, #[SerializeParam] YoutubeDistri public function redistribute(YoutubeDistribution $distribution, #[SerializeParam] YoutubeDistribution $newYoutubeDistribution): JsonResponse { App::throwOnReadOnlyMode(); - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $this->assetRepository->find($distribution->getAssetId())); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $this->assetRepository->find($distribution->getAssetId())); $this->denyAccessUnlessGranted(DamPermissions::DAM_DISTRIBUTION_ACCESS, $distribution->getDistributionService()); return $this->okResponse( diff --git a/src/Controller/Api/Sys/V1/AssetFileController.php b/src/Controller/Api/Sys/V1/AssetFileController.php index 203a9a3d..ba397112 100644 --- a/src/Controller/Api/Sys/V1/AssetFileController.php +++ b/src/Controller/Api/Sys/V1/AssetFileController.php @@ -73,7 +73,7 @@ public function createFromUrl(#[SerializeParam] AssetFileSysUrlCreateDto $dto): #[OAResponse(AssetFileSysDetailDecorator::class)] public function getOne(AssetFile $assetFile): JsonResponse { - $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_VIEW, $assetFile->getAsset()); + $this->denyAccessUnlessGranted(DamPermissions::DAM_ASSET_READ, $assetFile->getAsset()); return $this->okResponse( AssetFileSysDetailDecorator::getInstance($assetFile) diff --git a/src/Domain/AssetMetadata/AssetMetadataBulkFacade.php b/src/Domain/AssetMetadata/AssetMetadataBulkFacade.php index 5dbcaea3..fa455871 100644 --- a/src/Domain/AssetMetadata/AssetMetadataBulkFacade.php +++ b/src/Domain/AssetMetadata/AssetMetadataBulkFacade.php @@ -79,10 +79,10 @@ private function checkPermissions(FormProvidableMetadataBulkUpdateDto $updateDto { $this->accessDenier->denyUnlessGranted(DamPermissions::DAM_ASSET_UPDATE, $updateDto->getAsset()); foreach ($updateDto->getAuthors() as $author) { - $this->accessDenier->denyUnlessGranted(DamPermissions::DAM_AUTHOR_VIEW, $author); + $this->accessDenier->denyUnlessGranted(DamPermissions::DAM_AUTHOR_READ, $author); } foreach ($updateDto->getKeywords() as $keyword) { - $this->accessDenier->denyUnlessGranted(DamPermissions::DAM_KEYWORD_VIEW, $keyword); + $this->accessDenier->denyUnlessGranted(DamPermissions::DAM_KEYWORD_READ, $keyword); } } } diff --git a/src/Security/Permission/DamPermissions.php b/src/Security/Permission/DamPermissions.php index 543c2527..83fa910d 100644 --- a/src/Security/Permission/DamPermissions.php +++ b/src/Security/Permission/DamPermissions.php @@ -11,25 +11,25 @@ class DamPermissions // Asset public const string DAM_ASSET_CREATE = 'dam_asset_create'; public const string DAM_ASSET_UPDATE = 'dam_asset_update'; - public const string DAM_ASSET_VIEW = 'dam_asset_read'; + public const string DAM_ASSET_READ = 'dam_asset_read'; public const string DAM_ASSET_DELETE = 'dam_asset_delete'; // Video public const string DAM_VIDEO_CREATE = 'dam_video_create'; public const string DAM_VIDEO_UPDATE = 'dam_video_update'; - public const string DAM_VIDEO_VIEW = 'dam_video_read'; + public const string DAM_VIDEO_READ = 'dam_video_read'; public const string DAM_VIDEO_DELETE = 'dam_video_delete'; // Audio public const string DAM_AUDIO_CREATE = 'dam_audio_create'; public const string DAM_AUDIO_UPDATE = 'dam_audio_update'; - public const string DAM_AUDIO_VIEW = 'dam_audio_read'; + public const string DAM_AUDIO_READ = 'dam_audio_read'; public const string DAM_AUDIO_DELETE = 'dam_audio_delete'; // Asset Custom Form public const string DAM_CUSTOM_FORM_CREATE = 'dam_assetCustomForm_create'; public const string DAM_CUSTOM_FORM_UPDATE = 'dam_assetCustomForm_update'; - public const string DAM_CUSTOM_FORM_VIEW = 'dam_assetCustomForm_read'; + public const string DAM_CUSTOM_FORM_READ = 'dam_assetCustomForm_read'; // Custom Form Element public const string DAM_CUSTOM_FORM_ELEMENT_VIEW = 'dam_customFormElement_read'; @@ -37,79 +37,79 @@ class DamPermissions // Document public const string DAM_DOCUMENT_CREATE = 'dam_document_create'; public const string DAM_DOCUMENT_UPDATE = 'dam_document_update'; - public const string DAM_DOCUMENT_VIEW = 'dam_document_read'; + public const string DAM_DOCUMENT_READ = 'dam_document_read'; public const string DAM_DOCUMENT_DELETE = 'dam_document_delete'; // Image public const string DAM_IMAGE_CREATE = 'dam_image_create'; public const string DAM_IMAGE_UPDATE = 'dam_image_update'; - public const string DAM_IMAGE_VIEW = 'dam_image_read'; + public const string DAM_IMAGE_READ = 'dam_image_read'; public const string DAM_IMAGE_DELETE = 'dam_image_delete'; // Region of Interest public const string DAM_REGION_OF_INTEREST_CREATE = 'dam_regionOfInterest_create'; public const string DAM_REGION_OF_INTEREST_UPDATE = 'dam_regionOfInterest_update'; - public const string DAM_REGION_OF_INTEREST_VIEW = 'dam_regionOfInterest_read'; + public const string DAM_REGION_OF_INTEREST_READ = 'dam_regionOfInterest_read'; public const string DAM_REGION_OF_INTEREST_DELETE = 'dam_regionOfInterest_delete'; // ExtSystem public const string DAM_EXT_SYSTEM_UPDATE = 'dam_extSystem_update'; - public const string DAM_EXT_SYSTEM_VIEW = 'dam_extSystem_read'; + public const string DAM_EXT_SYSTEM_READ = 'dam_extSystem_read'; public const string DAM_EXT_SYSTEM_LIST = 'dam_extSystem_list'; public const string DAM_EXT_SYSTEM_UI = 'dam_extSystem_ui'; // AssetLicence public const string DAM_ASSET_LICENCE_CREATE = 'dam_assetLicence_create'; public const string DAM_ASSET_LICENCE_UPDATE = 'dam_assetLicence_update'; - public const string DAM_ASSET_LICENCE_VIEW = 'dam_assetLicence_read'; + public const string DAM_ASSET_LICENCE_READ = 'dam_assetLicence_read'; public const string DAM_ASSET_LICENCE_LIST = 'dam_assetLicence_list'; public const string DAM_ASSET_LICENCE_UI = 'dam_assetLicence_ui'; // AssetLicenceGroup public const string DAM_ASSET_LICENCE_GROUP_CREATE = 'dam_assetLicenceGroup_create'; public const string DAM_ASSET_LICENCE_GROUP_UPDATE = 'dam_assetLicenceGroup_update'; - public const string DAM_ASSET_LICENCE_GROUP_VIEW = 'dam_assetLicenceGroup_read'; + public const string DAM_ASSET_LICENCE_GROUP_READ = 'dam_assetLicenceGroup_read'; public const string DAM_ASSET_LICENCE_GROUP_LIST = 'dam_assetLicenceGroup_list'; public const string DAM_ASSET_LICENCE_GROUP_UI = 'dam_assetLicenceGroup_ui'; // Author public const string DAM_AUTHOR_CREATE = 'dam_author_create'; public const string DAM_AUTHOR_UPDATE = 'dam_author_update'; - public const string DAM_AUTHOR_VIEW = 'dam_author_read'; + public const string DAM_AUTHOR_READ = 'dam_author_read'; public const string DAM_AUTHOR_DELETE = 'dam_author_delete'; public const string DAM_AUTHOR_UI = 'dam_author_ui'; // Keyword public const string DAM_KEYWORD_CREATE = 'dam_keyword_create'; public const string DAM_KEYWORD_UPDATE = 'dam_keyword_update'; - public const string DAM_KEYWORD_VIEW = 'dam_keyword_read'; + public const string DAM_KEYWORD_READ = 'dam_keyword_read'; public const string DAM_KEYWORD_DELETE = 'dam_keyword_delete'; public const string DAM_KEYWORD_UI = 'dam_keyword_ui'; // Podcast public const string DAM_PODCAST_CREATE = 'dam_podcast_create'; public const string DAM_PODCAST_UPDATE = 'dam_podcast_update'; - public const string DAM_PODCAST_VIEW = 'dam_podcast_read'; + public const string DAM_PODCAST_READ = 'dam_podcast_read'; public const string DAM_PODCAST_DELETE = 'dam_podcast_delete'; public const string DAM_PODCAST_UI = 'dam_podcast_ui'; // Podcast Episode public const string DAM_PODCAST_EPISODE_CREATE = 'dam_podcastEpisode_create'; public const string DAM_PODCAST_EPISODE_UPDATE = 'dam_podcastEpisode_update'; - public const string DAM_PODCAST_EPISODE_VIEW = 'dam_podcastEpisode_read'; + public const string DAM_PODCAST_EPISODE_READ = 'dam_podcastEpisode_read'; public const string DAM_PODCAST_EPISODE_DELETE = 'dam_podcastEpisode_delete'; public const string DAM_PODCAST_EPISODE_UI = 'dam_podcastEpisode_ui'; // Distribution Category public const string DAM_DISTRIBUTION_CATEGORY_CREATE = 'dam_distributionCategory_create'; public const string DAM_DISTRIBUTION_CATEGORY_UPDATE = 'dam_distributionCategory_update'; - public const string DAM_DISTRIBUTION_CATEGORY_VIEW = 'dam_distributionCategory_read'; + public const string DAM_DISTRIBUTION_CATEGORY_READ = 'dam_distributionCategory_read'; public const string DAM_DISTRIBUTION_CATEGORY_DELETE = 'dam_distributionCategory_delete'; public const string DAM_DISTRIBUTION_CATEGORY_UI = 'dam_distributionCategory_ui'; // Distribution Category Select public const string DAM_DISTRIBUTION_CATEGORY_SELECT_UPDATE = 'dam_distributionCategorySelect_update'; - public const string DAM_DISTRIBUTION_CATEGORY_SELECT_VIEW = 'dam_distributionCategorySelect_read'; + public const string DAM_DISTRIBUTION_CATEGORY_SELECT_READ = 'dam_distributionCategorySelect_read'; public const string DAM_DISTRIBUTION_CATEGORY_SELECT_UI = 'dam_distributionCategorySelect_ui'; // Distribution @@ -122,7 +122,7 @@ class DamPermissions // PermissionGroup public const string DAM_PERMISSION_GROUP_CREATE = 'dam_permissionGroup_create'; public const string DAM_PERMISSION_GROUP_UPDATE = 'dam_permissionGroup_update'; - public const string DAM_PERMISSION_GROUP_VIEW = 'dam_permissionGroup_read'; + public const string DAM_PERMISSION_GROUP_READ = 'dam_permissionGroup_read'; public const string DAM_PERMISSION_GROUP_DELETE = 'dam_permissionGroup_delete'; public const string DAM_PERMISSION_GROUP_UI = 'dam_permissionGroup_ui'; @@ -132,14 +132,14 @@ class DamPermissions // VideoShow public const string DAM_VIDEO_SHOW_CREATE = 'dam_videoShow_create'; public const string DAM_VIDEO_SHOW_UPDATE = 'dam_videoShow_update'; - public const string DAM_VIDEO_SHOW_VIEW = 'dam_videoShow_read'; + public const string DAM_VIDEO_SHOW_READ = 'dam_videoShow_read'; public const string DAM_VIDEO_SHOW_DELETE = 'dam_videoShow_delete'; public const string DAM_VIDEO_SHOW_UI = 'dam_videoShow_ui'; // VideoShowEpisode public const string DAM_VIDEO_SHOW_EPISODE_CREATE = 'dam_videoShowEpisode_create'; public const string DAM_VIDEO_SHOW_EPISODE_UPDATE = 'dam_videoShowEpisode_update'; - public const string DAM_VIDEO_SHOW_EPISODE_VIEW = 'dam_videoShowEpisode_read'; + public const string DAM_VIDEO_SHOW_EPISODE_READ = 'dam_videoShowEpisode_read'; public const string DAM_VIDEO_SHOW_EPISODE_DELETE = 'dam_videoShowEpisode_delete'; public const string DAM_VIDEO_SHOW_EPISODE_UI = 'dam_videoShowEpisode_ui'; @@ -152,72 +152,72 @@ class DamPermissions public const array ALL = [ self::DAM_ASSET_CREATE, self::DAM_ASSET_UPDATE, - self::DAM_ASSET_VIEW, + self::DAM_ASSET_READ, self::DAM_ASSET_DELETE, self::DAM_VIDEO_CREATE, self::DAM_VIDEO_UPDATE, - self::DAM_VIDEO_VIEW, + self::DAM_VIDEO_READ, self::DAM_VIDEO_DELETE, self::DAM_AUDIO_CREATE, self::DAM_AUDIO_UPDATE, - self::DAM_AUDIO_VIEW, + self::DAM_AUDIO_READ, self::DAM_AUDIO_DELETE, self::DAM_CUSTOM_FORM_CREATE, self::DAM_CUSTOM_FORM_UPDATE, - self::DAM_CUSTOM_FORM_VIEW, + self::DAM_CUSTOM_FORM_READ, self::DAM_CUSTOM_FORM_ELEMENT_VIEW, self::DAM_DOCUMENT_CREATE, self::DAM_DOCUMENT_UPDATE, - self::DAM_DOCUMENT_VIEW, + self::DAM_DOCUMENT_READ, self::DAM_DOCUMENT_DELETE, self::DAM_IMAGE_CREATE, self::DAM_IMAGE_UPDATE, - self::DAM_IMAGE_VIEW, + self::DAM_IMAGE_READ, self::DAM_IMAGE_DELETE, self::DAM_REGION_OF_INTEREST_CREATE, self::DAM_REGION_OF_INTEREST_UPDATE, - self::DAM_REGION_OF_INTEREST_VIEW, + self::DAM_REGION_OF_INTEREST_READ, self::DAM_REGION_OF_INTEREST_DELETE, self::DAM_EXT_SYSTEM_UPDATE, - self::DAM_EXT_SYSTEM_VIEW, + self::DAM_EXT_SYSTEM_READ, self::DAM_EXT_SYSTEM_LIST, self::DAM_EXT_SYSTEM_UI, self::DAM_ASSET_LICENCE_CREATE, self::DAM_ASSET_LICENCE_UPDATE, - self::DAM_ASSET_LICENCE_VIEW, + self::DAM_ASSET_LICENCE_READ, self::DAM_ASSET_LICENCE_LIST, self::DAM_ASSET_LICENCE_UI, self::DAM_AUTHOR_CREATE, self::DAM_AUTHOR_UPDATE, - self::DAM_AUTHOR_VIEW, + self::DAM_AUTHOR_READ, self::DAM_AUTHOR_DELETE, self::DAM_AUTHOR_UI, self::DAM_KEYWORD_CREATE, self::DAM_KEYWORD_UPDATE, - self::DAM_KEYWORD_VIEW, + self::DAM_KEYWORD_READ, self::DAM_KEYWORD_DELETE, self::DAM_KEYWORD_UI, self::DAM_DISTRIBUTION_CATEGORY_CREATE, self::DAM_DISTRIBUTION_CATEGORY_UPDATE, - self::DAM_DISTRIBUTION_CATEGORY_VIEW, + self::DAM_DISTRIBUTION_CATEGORY_READ, self::DAM_DISTRIBUTION_CATEGORY_DELETE, self::DAM_DISTRIBUTION_CATEGORY_UI, self::DAM_DISTRIBUTION_CATEGORY_SELECT_UPDATE, - self::DAM_DISTRIBUTION_CATEGORY_SELECT_VIEW, + self::DAM_DISTRIBUTION_CATEGORY_SELECT_READ, self::DAM_DISTRIBUTION_CATEGORY_SELECT_UI, self::DAM_ASSET_EXTERNAL_PROVIDER_ACCESS, self::DAM_DISTRIBUTION_ACCESS, self::DAM_PODCAST_CREATE, self::DAM_PODCAST_UPDATE, - self::DAM_PODCAST_VIEW, + self::DAM_PODCAST_READ, self::DAM_PODCAST_DELETE, self::DAM_PODCAST_UI, self::DAM_PODCAST_EPISODE_CREATE, self::DAM_PODCAST_EPISODE_UPDATE, - self::DAM_PODCAST_EPISODE_VIEW, + self::DAM_PODCAST_EPISODE_READ, self::DAM_PODCAST_EPISODE_DELETE, self::DAM_PODCAST_EPISODE_UI, - self::DAM_PERMISSION_GROUP_VIEW, + self::DAM_PERMISSION_GROUP_READ, self::DAM_PERMISSION_GROUP_CREATE, self::DAM_PERMISSION_GROUP_UPDATE, self::DAM_PERMISSION_GROUP_DELETE, @@ -225,12 +225,12 @@ class DamPermissions self::DAM_LOG_UI, self::DAM_VIDEO_SHOW_CREATE, self::DAM_VIDEO_SHOW_UPDATE, - self::DAM_VIDEO_SHOW_VIEW, + self::DAM_VIDEO_SHOW_READ, self::DAM_VIDEO_SHOW_DELETE, self::DAM_VIDEO_SHOW_UI, self::DAM_VIDEO_SHOW_EPISODE_CREATE, self::DAM_VIDEO_SHOW_EPISODE_UPDATE, - self::DAM_VIDEO_SHOW_EPISODE_VIEW, + self::DAM_VIDEO_SHOW_EPISODE_READ, self::DAM_VIDEO_SHOW_EPISODE_DELETE, self::DAM_VIDEO_SHOW_EPISODE_UI, self::DAM_JOB_VIEW, @@ -239,7 +239,7 @@ class DamPermissions self::DAM_JOB_UI, self::DAM_DISTRIBUTION_VIEW, self::DAM_DISTRIBUTION_ACCESS, - self::DAM_ASSET_LICENCE_GROUP_VIEW, + self::DAM_ASSET_LICENCE_GROUP_READ, self::DAM_ASSET_LICENCE_GROUP_UPDATE, self::DAM_ASSET_LICENCE_GROUP_LIST, self::DAM_ASSET_LICENCE_GROUP_CREATE, diff --git a/src/Security/Voter/AssetExtSystemAdminVoter.php b/src/Security/Voter/AssetExtSystemAdminVoter.php index 663ee584..9aa4bdfa 100644 --- a/src/Security/Voter/AssetExtSystemAdminVoter.php +++ b/src/Security/Voter/AssetExtSystemAdminVoter.php @@ -37,7 +37,7 @@ protected function permissionVote(string $attribute, mixed $subject, AnzuUser $u protected function getSupportedPermissions(): array { return [ - DamPermissions::DAM_ASSET_VIEW, + DamPermissions::DAM_ASSET_READ, ]; } } diff --git a/src/Security/Voter/AssetLicenceAwareVoter.php b/src/Security/Voter/AssetLicenceAwareVoter.php index 5b88d04f..7ceaecc3 100644 --- a/src/Security/Voter/AssetLicenceAwareVoter.php +++ b/src/Security/Voter/AssetLicenceAwareVoter.php @@ -42,28 +42,28 @@ protected function getSupportedPermissions(): array return [ DamPermissions::DAM_ASSET_CREATE, DamPermissions::DAM_ASSET_UPDATE, - DamPermissions::DAM_ASSET_VIEW, + DamPermissions::DAM_ASSET_READ, DamPermissions::DAM_ASSET_DELETE, DamPermissions::DAM_VIDEO_CREATE, DamPermissions::DAM_VIDEO_UPDATE, - DamPermissions::DAM_VIDEO_VIEW, + DamPermissions::DAM_VIDEO_READ, DamPermissions::DAM_VIDEO_DELETE, DamPermissions::DAM_AUDIO_CREATE, DamPermissions::DAM_AUDIO_UPDATE, - DamPermissions::DAM_AUDIO_VIEW, + DamPermissions::DAM_AUDIO_READ, DamPermissions::DAM_AUDIO_DELETE, DamPermissions::DAM_DOCUMENT_CREATE, DamPermissions::DAM_DOCUMENT_UPDATE, - DamPermissions::DAM_DOCUMENT_VIEW, + DamPermissions::DAM_DOCUMENT_READ, DamPermissions::DAM_IMAGE_CREATE, DamPermissions::DAM_IMAGE_UPDATE, - DamPermissions::DAM_IMAGE_VIEW, + DamPermissions::DAM_IMAGE_READ, DamPermissions::DAM_IMAGE_DELETE, DamPermissions::DAM_REGION_OF_INTEREST_CREATE, - DamPermissions::DAM_REGION_OF_INTEREST_VIEW, + DamPermissions::DAM_REGION_OF_INTEREST_READ, DamPermissions::DAM_REGION_OF_INTEREST_UPDATE, DamPermissions::DAM_REGION_OF_INTEREST_DELETE, - DamPermissions::DAM_ASSET_LICENCE_VIEW, + DamPermissions::DAM_ASSET_LICENCE_READ, ]; } } diff --git a/src/Security/Voter/BaseVoter.php b/src/Security/Voter/BaseVoter.php index 689aac7a..9a6c09a1 100644 --- a/src/Security/Voter/BaseVoter.php +++ b/src/Security/Voter/BaseVoter.php @@ -29,7 +29,7 @@ protected function getSupportedPermissions(): array DamPermissions::DAM_ASSET_LICENCE_GROUP_CREATE, DamPermissions::DAM_ASSET_LICENCE_GROUP_LIST, DamPermissions::DAM_ASSET_LICENCE_GROUP_UPDATE, - DamPermissions::DAM_ASSET_LICENCE_GROUP_VIEW, + DamPermissions::DAM_ASSET_LICENCE_GROUP_READ, ]; } } diff --git a/src/Security/Voter/CollectionListAwareVoter.php b/src/Security/Voter/CollectionListAwareVoter.php index c79d3096..d67cedf4 100644 --- a/src/Security/Voter/CollectionListAwareVoter.php +++ b/src/Security/Voter/CollectionListAwareVoter.php @@ -48,7 +48,7 @@ protected function permissionVote(string $attribute, mixed $subject, AnzuUser $u protected function getSupportedPermissions(): array { return [ - DamPermissions::DAM_ASSET_VIEW, + DamPermissions::DAM_ASSET_READ, DamPermissions::DAM_DISTRIBUTION_VIEW, ]; } diff --git a/src/Security/Voter/DistributionVoter.php b/src/Security/Voter/DistributionVoter.php index 3351f9f5..6c4cae67 100644 --- a/src/Security/Voter/DistributionVoter.php +++ b/src/Security/Voter/DistributionVoter.php @@ -52,8 +52,8 @@ protected function permissionVote(string $attribute, mixed $subject, AnzuUser $u return false; } - return $this->assetLicenceAwareVoter->permissionVote(DamPermissions::DAM_ASSET_VIEW, $asset, $user) - && $this->assetLicenceAwareVoter->permissionVote(DamPermissions::DAM_ASSET_VIEW, $assetFile, $user); + return $this->assetLicenceAwareVoter->permissionVote(DamPermissions::DAM_ASSET_READ, $asset, $user) + && $this->assetLicenceAwareVoter->permissionVote(DamPermissions::DAM_ASSET_READ, $assetFile, $user); } protected function getSupportedPermissions(): array diff --git a/src/Security/Voter/ExtSystemAwareVoter.php b/src/Security/Voter/ExtSystemAwareVoter.php index f7a22182..18cd8da7 100644 --- a/src/Security/Voter/ExtSystemAwareVoter.php +++ b/src/Security/Voter/ExtSystemAwareVoter.php @@ -43,38 +43,38 @@ protected function getSupportedPermissions(): array { return [ DamPermissions::DAM_ASSET_CREATE, - DamPermissions::DAM_ASSET_VIEW, - DamPermissions::DAM_AUTHOR_VIEW, + DamPermissions::DAM_ASSET_READ, + DamPermissions::DAM_AUTHOR_READ, DamPermissions::DAM_AUTHOR_CREATE, DamPermissions::DAM_AUTHOR_UPDATE, DamPermissions::DAM_AUTHOR_DELETE, - DamPermissions::DAM_KEYWORD_VIEW, + DamPermissions::DAM_KEYWORD_READ, DamPermissions::DAM_KEYWORD_CREATE, DamPermissions::DAM_KEYWORD_UPDATE, DamPermissions::DAM_KEYWORD_DELETE, DamPermissions::DAM_DISTRIBUTION_CATEGORY_CREATE, DamPermissions::DAM_DISTRIBUTION_CATEGORY_UPDATE, - DamPermissions::DAM_DISTRIBUTION_CATEGORY_VIEW, + DamPermissions::DAM_DISTRIBUTION_CATEGORY_READ, DamPermissions::DAM_DISTRIBUTION_CATEGORY_DELETE, DamPermissions::DAM_DISTRIBUTION_CATEGORY_SELECT_UPDATE, - DamPermissions::DAM_DISTRIBUTION_CATEGORY_SELECT_VIEW, - DamPermissions::DAM_EXT_SYSTEM_VIEW, + DamPermissions::DAM_DISTRIBUTION_CATEGORY_SELECT_READ, + DamPermissions::DAM_EXT_SYSTEM_READ, DamPermissions::DAM_CUSTOM_FORM_UPDATE, - DamPermissions::DAM_CUSTOM_FORM_VIEW, + DamPermissions::DAM_CUSTOM_FORM_READ, DamPermissions::DAM_CUSTOM_FORM_CREATE, - DamPermissions::DAM_PODCAST_VIEW, + DamPermissions::DAM_PODCAST_READ, DamPermissions::DAM_PODCAST_DELETE, DamPermissions::DAM_PODCAST_UPDATE, DamPermissions::DAM_PODCAST_CREATE, - DamPermissions::DAM_PODCAST_EPISODE_VIEW, + DamPermissions::DAM_PODCAST_EPISODE_READ, DamPermissions::DAM_PODCAST_EPISODE_DELETE, DamPermissions::DAM_PODCAST_EPISODE_UPDATE, DamPermissions::DAM_PODCAST_EPISODE_CREATE, - DamPermissions::DAM_VIDEO_SHOW_VIEW, + DamPermissions::DAM_VIDEO_SHOW_READ, DamPermissions::DAM_VIDEO_SHOW_DELETE, DamPermissions::DAM_VIDEO_SHOW_UPDATE, DamPermissions::DAM_VIDEO_SHOW_CREATE, - DamPermissions::DAM_VIDEO_SHOW_EPISODE_VIEW, + DamPermissions::DAM_VIDEO_SHOW_EPISODE_READ, DamPermissions::DAM_VIDEO_SHOW_EPISODE_DELETE, DamPermissions::DAM_VIDEO_SHOW_EPISODE_UPDATE, DamPermissions::DAM_VIDEO_SHOW_EPISODE_CREATE,