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 committed Aug 28, 2023
1 parent bbdb914 commit f1b6264
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 f1b6264

Please sign in to comment.