|
|
|
@ -36,6 +36,9 @@ class ReserveReservationAccessControlHandler extends EntityAccessControlHandler
|
|
|
|
|
|
|
|
|
|
case 'delete': |
|
|
|
|
$access = AccessResult::allowedIfHasPermission($account, 'delete any reservation'); |
|
|
|
|
if (!$access->isAllowed() && $account->hasPermission('delete own reservation')) { |
|
|
|
|
$access = $access->orIf(AccessResult::allowedIf($account->id() == $entity->getOwnerId())->cachePerUser()->addCacheableDependency($entity)); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
// Unknown operation, no opinion. |
|
|
|
|