src/Security/Voter/LeadVoter.php line 5

Open in your IDE?
  1. <?php
  2. namespace App\Security\Voter;
  3. final class LeadVoter extends SiteProtectedResourceVoter
  4. {
  5.     const VIEW 'LEAD_VIEW';
  6.     const EDIT 'LEAD_EDIT';
  7.     protected function supports($attribute$subject)
  8.     {
  9.         if (!in_array($attribute, [self::VIEWself::EDIT])) {
  10.             return false;
  11.         }
  12.         return true;
  13.     }
  14.     protected function isViewAction(string $attribute): bool
  15.     {
  16.         return self::VIEW === $attribute;
  17.     }
  18.     protected function isEditAction(string $attribute): bool
  19.     {
  20.         return self::EDIT === $attribute;
  21.     }
  22. }