/**
  * Adds options to the actions
  *
  * @param ConfigureActionEvent $event
  */
 public function setDefaultOptions(ConfigureActionEvent $event)
 {
     $resolver = $event->getOptionsResolver();
     $options = $event->getAction()->getConfiguration()->getOptions();
     if (isset($options['acl'])) {
         $resolver->setDefaults(['acl' => $options['acl']]);
     } else {
         $resolver->setDefined(['acl']);
     }
     $resolver->setDefined(['acl_suffix']);
     $resolver->setNormalizer('acl', function ($actionOptions, $acl) use($options) {
         if (null === $acl && isset($options['acl_prefix']) && isset($actionOptions['acl_suffix'])) {
             return $options['acl_prefix'] . $options['acl_separator'] . $actionOptions['acl_suffix'];
         }
         return $acl;
     });
     $customEntityName = $event->getAction()->getConfiguration()->getName();
     $normalizeActions = function ($options, $actionTypes) use($customEntityName) {
         return array_filter($actionTypes, function ($actionType) use($customEntityName) {
             $action = $this->actionFactory->getAction($customEntityName, $actionType);
             $options = $action->getOptions();
             return !isset($options['acl']) || $this->securityFacade->isGranted($options['acl']);
         });
     };
     if ('index' === $event->getAction()->getType()) {
         $resolver->setNormalizer('row_actions', $normalizeActions);
         $resolver->setNormalizer('mass_actions', $normalizeActions);
     }
 }
 /**
  * Adds options to the actions
  *
  * @param ConfigureActionEvent $event
  */
 public function setActionOptions(ConfigureActionEvent $event)
 {
     if (!$event->getAction() instanceof AbstractFormAction) {
         return;
     }
     $confOptions = $event->getAction()->getConfiguration()->getOptions();
     $resolver = $event->getOptionsResolver();
     if (isset($confOptions['form_type'])) {
         $resolver->setDefaults(['form_type' => $confOptions['form_type']]);
     }
     if (isset($confOptions['form_options'])) {
         $resolver->setDefaults(['form_options' => $confOptions['form_options']]);
     }
     if (isset($confOptions['form_template'])) {
         $resolver->setDefaults(['template' => $confOptions['form_template']]);
     }
 }