Skip to content

Commit

Permalink
IBX-2942: Added missing edit permission restriction in UDW response (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ciastektk authored Sep 4, 2023
1 parent 30c6715 commit 118c25f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib/UniversalDiscovery/UniversalDiscoveryProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -199,6 +204,8 @@ public function getLocationPermissionRestrictions(Location $location): array
],
'edit' => [
'hasAccess' => $lookupUpdateLimitationsResult->hasAccess,
'restrictedContentTypeIds' => $updateLimitationsValues[Limitation::CONTENTTYPE],
'restrictedLanguageCodes' => $updateLimitationsValues[Limitation::LANGUAGE],
],
];
}
Expand Down

0 comments on commit 118c25f

Please sign in to comment.