From 2892a1c7300c5a11915d58d67f8fe0a2d7bc4278 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 5 Nov 2024 09:38:46 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Konrad Oboza --- src/contracts/Repository/ContentService.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/contracts/Repository/ContentService.php b/src/contracts/Repository/ContentService.php index ab7d8f71a8..481bdc9c8e 100644 --- a/src/contracts/Repository/ContentService.php +++ b/src/contracts/Repository/ContentService.php @@ -49,7 +49,7 @@ public function loadContentInfo(int $contentId): ContentInfo; * * @param array $contentIds * - * @return array List of ContentInfo with Content Ids as keys + * @return array List of ContentInfo with content ids as keys */ public function loadContentInfoList(array $contentIds): iterable; @@ -132,7 +132,9 @@ public function loadContentByVersionInfo(VersionInfo $versionInfo, array $langua * If no version number is given, the method returns the current version * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException if the content or version with the given id and languages doesn't exist. - * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user has no access to "read content", or, in case of un-published content, "read versions". + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user lacks: + * - `content/read` permission for published content, or + * - `content/read` and `content/versionread` permissions for draft content. * * @param array $languages A language priority, filters returned fields and is used as prioritized language code on * returned value object. If not given all languages are returned. @@ -147,7 +149,9 @@ public function loadContent(int $contentId, array $languages = null, ?int $versi * If no version is given, the method returns the current version * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException if the content or version with the given remote id doesn't exist. - * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user has no access to "read content", or, in case of un-published content, "read versions". + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user lacks: + * - `content/read` permission for published content, or + * - `content/read` and `content/versionread` permissions for draft content. * * @param string[] $languages A language priority, filters returned fields and is used as prioritized language code on * returned value object. If not given all languages are returned. @@ -261,7 +265,7 @@ public function countContentDrafts(?User $user = null): int; * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the current user is not allowed to load the draft list * - * @param \Ibexa\Contracts\Core\Repository\Values\User\User|null $user The user to load drafts for, if defined; otherwise drafts for current user. + * @param \Ibexa\Contracts\Core\Repository\Values\User\User|null $user The user to load drafts for. If `null`, the current user's drafts are loaded. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo[] The drafts owned by the given user. */