( ! ) Warning: Undefined variable $namespace in /home/homes/thomastestaud/sites/thomastestaud.fr_2.0/vendor/symfony/maker-bundle/src/Resources/skeleton/security/Voter.tpl.php on line 3 |
Call Stack |
# | Time | Memory | Function | Location |
1 | 0.0098 | 359416 | {main}( ) | .../Voter.tpl.php:0 |
;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
use Symfony\Component\Security\Core\User\UserInterface;
class
( ! ) Warning: Undefined variable $class_name in /home/homes/thomastestaud/sites/thomastestaud.fr_2.0/vendor/symfony/maker-bundle/src/Resources/skeleton/security/Voter.tpl.php on line 9 |
Call Stack |
# | Time | Memory | Function | Location |
1 | 0.0098 | 359416 | {main}( ) | .../Voter.tpl.php:0 |
extends Voter
{
public const EDIT = 'POST_EDIT';
public const VIEW = 'POST_VIEW';
protected function supports(string $attribute, mixed $subject): bool
{
// replace with your own logic
// https://symfony.com/doc/current/security/voters.html
return in_array($attribute, [self::EDIT, self::VIEW])
&& $subject instanceof \App\Entity\
( ! ) Warning: Undefined variable $class_name in /home/homes/thomastestaud/sites/thomastestaud.fr_2.0/vendor/symfony/maker-bundle/src/Resources/skeleton/security/Voter.tpl.php on line 19 |
Call Stack |
# | Time | Memory | Function | Location |
1 | 0.0098 | 359416 | {main}( ) | .../Voter.tpl.php:0 |
;
}
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
{
$user = $token->getUser();
// if the user is anonymous, do not grant access
if (!$user instanceof UserInterface) {
return false;
}
// ... (check conditions and return true to grant permission) ...
switch ($attribute) {
case self::EDIT:
// logic to determine if the user can EDIT
// return true or false
break;
case self::VIEW:
// logic to determine if the user can VIEW
// return true or false
break;
}
return false;
}
}