Skip to content

Commit 9388dce

Browse files
committed
implemented suggested changes
1 parent e8d4892 commit 9388dce

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/bundle/Controller/Content/ContentTreeController.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private function getLocationPermissionRestrictions(Location $location): array
226226
'restrictedLanguageCodes' => $createLimitationsValues[Limitation::LANGUAGE],
227227
],
228228
'edit' => [
229-
'hasAccess' => $this->canUserEditContent($location),
229+
'hasAccess' => $this->canUserEditContent($location->getContent()),
230230
// skipped content type limitation values as in this case it can be inferred from "hasAccess" above
231231
'restrictedLanguageCodes' => $updateLimitationsValues[Limitation::LANGUAGE],
232232
],
@@ -330,10 +330,8 @@ private function isPreviewable(
330330
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
331331
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
332332
*/
333-
private function canUserEditContent(Location $location): bool
333+
private function canUserEditContent(Content $content): bool
334334
{
335-
$content = $location->getContent();
336-
337335
return $this->permissionResolver->canUser(
338336
'content',
339337
'edit',

0 commit comments

Comments
 (0)