src/Daikin/BaseBundle/Security/Voter/DaikinVoter.php line 8

Open in your IDE?
  1. <?php
  2. namespace App\Daikin\BaseBundle\Security\Voter;
  3. use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
  4. use Symfony\Component\Security\Core\Authorization\Voter\Voter;
  5. class DaikinVoter extends Voter
  6. {
  7.     private string $theme;
  8.     public function __construct($theme)
  9.     {
  10.         $this->theme $theme;
  11.     }
  12.     protected function supports($attribute$subject): bool
  13.     {
  14.         return $attribute === 'DAIKIN';
  15.     }
  16.     protected function voteOnAttribute($attribute$subjectTokenInterface $token): bool
  17.     {
  18.         return $this->theme == 'daikin' || $this->theme == 'dace';
  19.     }
  20. }