src/Security/BackOffice/UomVoter.php line 8

Open in your IDE?
  1. <?php
  2. namespace App\Security\BackOffice;
  3. use App\Security\BaseCrudVoter;
  4. use App\Entity\Uom;
  5. class UomVoter extends BaseCrudVoter
  6. {
  7.     const ROLE_ALL 'ROLE_ADMIN_UOM';
  8.     const ROLE_READ 'ROLE_ADMIN_UOM_READ';
  9.     const ROLE_WRITE 'ROLE_ADMIN_UOM_WRITE';
  10.     const ROLE_DELETE 'ROLE_ADMIN_UOM_DELETE';
  11.     protected function supports($attribute$subject)
  12.     {
  13.         parent::supports($attribute$subject);
  14.         // only vote on Post objects inside this voter
  15.         if (!$subject instanceof Uom) {
  16.             return false;
  17.         }
  18.         return true// supports
  19.     }
  20. }