<?php
/**
* @author Thomas HERISSON (contact@scaledev.fr)
* @copyright 2021 - ScaleDEV SAS, 12 RUE CHARLES MORET, 10120 ST ANDRE LES VERGERS
* @license commercial
*/
declare(strict_types=1);
namespace Bluue\ShopModulesBundle\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use App\Event\PermissionsConfigurationPageEvent;
class ConfigurePermissionsSubscriber implements EventSubscriberInterface
{
/**
* @return array
*/
public static function getSubscribedEvents(): array
{
return [
PermissionsConfigurationPageEvent::NAME => 'onLoad'
];
}
/**
* @param PermissionsConfigurationPageEvent $event
* @return void
*/
public function onLoad(PermissionsConfigurationPageEvent $event): void
{
$permissions = $event->getPermissions();
$permissions[] = [
'resource' => 'shop-modules/module'
];
$permissions[] = [
'resource' => 'shop-modules/version'
];
$event->setPermissions($permissions);
}
}