custom/plugins/CioBudget/src/Subscriber/BudgetShiftPermission.php line 28

Open in your IDE?
  1. <?php
  2. namespace CioBudget\Subscriber;
  3. use Shopware\Storefront\Event\StorefrontRenderEvent;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. use CioCustomerPermissionGroups\Event\CustomerAclRolesEvent;
  6. use CioCustomerPermissionGroups\Service\CheckCustomerPermissionsService;
  7. class BudgetShiftPermission implements EventSubscriberInterface
  8. {
  9.     private CheckCustomerPermissionsService $checkCustomerPermissionsService;
  10.     public function __construct(CheckCustomerPermissionsService $checkCustomerPermissionsService)
  11.     {
  12.         $this->checkCustomerPermissionsService $checkCustomerPermissionsService;
  13.     }
  14.     public static function getSubscribedEvents(): array
  15.     {
  16.         return [
  17.             CustomerAclRolesEvent::class => 'onCustomerAclRolesEvent',
  18.         ];
  19.     }
  20.     public function onCustomerAclRolesEvent(CustomerAclRolesEvent $event)
  21.     {
  22.         $event->addRoles([
  23.             [
  24.                 'title' => 'ALLOW_BUDGET_SHIFTS',
  25.                 'description' => 'Das Übertragen von Guthaben aus eigenen Budget an beliebige andere Budgets erlauben.'
  26.             ],
  27.             [
  28.                 'title' => 'ALLOW_ADDING_USERS_TO_BUDGET',
  29.                 'description' => 'Vertretern das Hinzufügen von Benutzern zum Budget erlauben.'
  30.             ],
  31.             [
  32.                 'title' => 'ALLOW_ACCESS_TO_BUDGET_HISTORY',
  33.                 'description' => 'Einsicht in Budget-Historie im Frontend.'
  34.             ]
  35.         ]);
  36.     }
  37. }