<?php
namespace App\Daikin\BaseBundle\Security\Voter;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
class DaikinVoter extends Voter
{
private string $theme;
public function __construct($theme)
{
$this->theme = $theme;
}
protected function supports($attribute, $subject): bool
{
return $attribute === 'DAIKIN';
}
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
{
return $this->theme == 'daikin' || $this->theme == 'dace';
}
}