Skip to content

Commit

Permalink
Update list authorization should be a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
dvlpp committed Jun 27, 2024
1 parent 40964ad commit 219e9de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Http/Middleware/Api/AppendListAuthorizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected function addAuthorizationsToJsonResponse(JsonResponse $jsonResponse)

$authorizations = [
'view' => [],
'update' => [],
'update' => false,
'delete' => [],
'create' => $this->sharpAuthorizationManager->isAllowed('create', $entityKey),
];
Expand All @@ -41,8 +41,8 @@ protected function addAuthorizationsToJsonResponse(JsonResponse $jsonResponse)
if ($this->sharpAuthorizationManager->isAllowed('view', $entityKey, $instanceId)) {
$authorizations['view'][] = $instanceId;
}
if ($this->sharpAuthorizationManager->isAllowed('update', $entityKey, $instanceId)) {
$authorizations['update'][] = $instanceId;
if (!$authorizations['update'] && $this->sharpAuthorizationManager->isAllowed('update', $entityKey, $instanceId)) {
$authorizations['update'] = true;
}
if ($this->sharpAuthorizationManager->isAllowed('delete', $entityKey, $instanceId)) {
$authorizations['delete'][] = $instanceId;
Expand Down

0 comments on commit 219e9de

Please sign in to comment.