<?php
namespace App\Security\BackOffice;
use App\Security\BaseCrudVoter;
use App\Entity\Uom;
class UomVoter extends BaseCrudVoter
{
const ROLE_ALL = 'ROLE_ADMIN_UOM';
const ROLE_READ = 'ROLE_ADMIN_UOM_READ';
const ROLE_WRITE = 'ROLE_ADMIN_UOM_WRITE';
const ROLE_DELETE = 'ROLE_ADMIN_UOM_DELETE';
protected function supports($attribute, $subject)
{
parent::supports($attribute, $subject);
// only vote on Post objects inside this voter
if (!$subject instanceof Uom) {
return false;
}
return true; // supports
}
}