Esempio n. 1
0
 /**
  * Generate a HTML link to a controller action.
  *
  * @param  string  $action
  * @param  string  $title
  * @param  array   $parameters
  * @param  array   $attributes
  * @return string
  */
 public function linkAction($action, $title = null, $parameters = array(), $attributes = array())
 {
     if (!$this->manager->hasActionAccess('GET', $action)) {
         return;
     }
     return parent::linkAction($action, $title, $parameters, $attributes);
 }
Esempio n. 2
0
 /**
  * Check if the user have role access
  *
  * @param  array $parameters
  * @return void
  */
 protected function checkRoleAccess(array $parameters = array())
 {
     $formMethod = $this->getMethod(array_get($parameters, 'method', 'post'));
     if (isset($parameters['url'])) {
         return $this->manager->hasUrlAccess($formMethod, $parameters['url']);
     } else {
         if (isset($parameters['route'])) {
             if (is_array($parameters['route'])) {
                 $route = current($parameters['route']);
             } else {
                 $route = $parameters['route'];
             }
             return $this->manager->hasRouteAccess($formMethod, $route);
         } else {
             if (isset($parameters['action'])) {
                 if (is_array($parameters['action'])) {
                     $action = current($parameters['action']);
                 } else {
                     $action = $parameters['action'];
                 }
                 return $this->manager->hasActionAccess($formMethod, $action);
             }
         }
     }
 }