Example #1
0
 public function getActions()
 {
     $actions = [];
     $securityContext = $this->container->get('security.context');
     $configActions = $this->getConfig()->get('actions');
     if (!is_array($configActions)) {
         return [];
     }
     foreach ($configActions as $action => $value) {
         $roleUtil = new RoleUtil();
         $roleName = $roleUtil->getRoleNameByResourceName($this->getBundlePrefix(), $this->getResourceName(), $action);
         if ($securityContext->isGranted($roleName)) {
             $actions[] = $value;
         }
     }
     return $actions;
 }