From 118c25f18088cf556c65291e1035c9a0e3916c58 Mon Sep 17 00:00:00 2001 From: ciastektk Date: Mon, 4 Sep 2023 15:49:28 +0200 Subject: [PATCH] IBX-2942: Added missing edit permission restriction in UDW response (#2109) https://issues.ibexa.co/browse/IBX-2942 --- src/lib/UniversalDiscovery/UniversalDiscoveryProvider.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/UniversalDiscovery/UniversalDiscoveryProvider.php b/src/lib/UniversalDiscovery/UniversalDiscoveryProvider.php index 4cc3ed19f9..0fee6be845 100644 --- a/src/lib/UniversalDiscovery/UniversalDiscoveryProvider.php +++ b/src/lib/UniversalDiscovery/UniversalDiscoveryProvider.php @@ -191,6 +191,11 @@ public function getLocationPermissionRestrictions(Location $location): array [Limitation::CONTENTTYPE, Limitation::LANGUAGE] ); + $updateLimitationsValues = $this->lookupLimitationsTransformer->getGroupedLimitationValues( + $lookupCreateLimitationsResult, + [Limitation::CONTENTTYPE, Limitation::LANGUAGE] + ); + return [ 'create' => [ 'hasAccess' => $lookupCreateLimitationsResult->hasAccess, @@ -199,6 +204,8 @@ public function getLocationPermissionRestrictions(Location $location): array ], 'edit' => [ 'hasAccess' => $lookupUpdateLimitationsResult->hasAccess, + 'restrictedContentTypeIds' => $updateLimitationsValues[Limitation::CONTENTTYPE], + 'restrictedLanguageCodes' => $updateLimitationsValues[Limitation::LANGUAGE], ], ]; }