vendor/bluue/customer-outstanding-bundle/src/EventSubscriber/ConfigurePermissionsSubscriber.php line 32

Open in your IDE?
  1. <?php
  2. /**
  3.  * @author Thomas HERISSON (contact@scaledev.fr)
  4.  * @copyright 2021 - ScaleDEV SAS, 12 RUE CHARLES MORET, 10120 ST ANDRE LES VERGERS
  5.  * @license commercial
  6.  */
  7. declare(strict_types=1);
  8. namespace Bluue\CustomerOutstandingBundle\EventSubscriber;
  9. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  10. use App\Event\PermissionsConfigurationPageEvent;
  11. class ConfigurePermissionsSubscriber implements EventSubscriberInterface
  12. {
  13.     /**
  14.      * @return array
  15.      */
  16.     public static function getSubscribedEvents(): array
  17.     {
  18.         return [
  19.             PermissionsConfigurationPageEvent::NAME => 'onLoad'
  20.         ];
  21.     }
  22.     /**
  23.      * @param PermissionsConfigurationPageEvent $event
  24.      * @return void
  25.      */
  26.     public function onLoad(PermissionsConfigurationPageEvent $event): void
  27.     {
  28.         $permissions $event->getPermissions();
  29.         $permissions[] = [
  30.             'resource' => 'customer-outstanding/customer-balance'
  31.         ];
  32.         $event->setPermissions($permissions);
  33.     }
  34. }