app/Service/Security/Voter/Organization/DeleteOrganizationVoter.php line 8

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Sq\Service\Security\Voter\Organization;
  3. use Sq\Entity\Schema\ORM\UserOrganizationAssignment;
  4. use Sq\Service\Security\Voter\SecurityAttributes;
  5. class DeleteOrganizationVoter extends AbstractOrganizationVoter
  6. {
  7.     protected function getSupportedAttributeName(): string
  8.     {
  9.         return SecurityAttributes::DELETE;
  10.     }
  11.     protected function getValidRolesForAttribute(): array
  12.     {
  13.         return [
  14.             UserOrganizationAssignment::ROLE_OWNER,
  15.         ];
  16.     }
  17.     protected function isAllowedWhenImpersonating(): bool
  18.     {
  19.         return false;
  20.     }
  21. }