<?php
namespace App\Security\Voter;
final class LeadVoter extends SiteProtectedResourceVoter
{
const VIEW = 'LEAD_VIEW';
const EDIT = 'LEAD_EDIT';
protected function supports($attribute, $subject)
{
if (!in_array($attribute, [self::VIEW, self::EDIT])) {
return false;
}
return true;
}
protected function isViewAction(string $attribute): bool
{
return self::VIEW === $attribute;
}
protected function isEditAction(string $attribute): bool
{
return self::EDIT === $attribute;
}
}