app/Service/Security/Voter/MobileApp/ViewMobileAppVoter.php line 8

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