@@ -49,7 +49,7 @@ class ContentTreeController extends RestController
49
49
50
50
private ConfigResolverInterface $ configResolver ;
51
51
52
- private SiteaccessResolverInterface $ siteaccessResolver ;
52
+ private SiteaccessResolverInterface $ siteaccessResolver ;
53
53
54
54
public function __construct (
55
55
LocationService $ locationService ,
@@ -226,7 +226,7 @@ private function getLocationPermissionRestrictions(Location $location): array
226
226
'restrictedLanguageCodes ' => $ createLimitationsValues [Limitation::LANGUAGE ],
227
227
],
228
228
'edit ' => [
229
- 'hasAccess ' => $ this ->canUserEditContent ($ location-> getContent () ),
229
+ 'hasAccess ' => $ this ->canUserEditContent ($ location ),
230
230
// skipped content type limitation values as in this case it can be inferred from "hasAccess" above
231
231
'restrictedLanguageCodes ' => $ updateLimitationsValues [Limitation::LANGUAGE ],
232
232
],
@@ -330,12 +330,13 @@ private function isPreviewable(
330
330
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
331
331
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
332
332
*/
333
- private function canUserEditContent (Content $ content ): bool
333
+ private function canUserEditContent (Location $ location ): bool
334
334
{
335
335
return $ this ->permissionResolver ->canUser (
336
336
'content ' ,
337
337
'edit ' ,
338
- $ content
338
+ $ location ->getContent (),
339
+ [$ location ]
339
340
);
340
341
}
341
342
}
0 commit comments