/** * Generate a HTML link to a named route. * * @param string $name * @param string $title * @param array $parameters * @param array $attributes * @return string */ public function linkRoute($name, $title = null, $parameters = array(), $attributes = array()) { if (!$this->manager->hasRouteAccess('GET', $name)) { return; } return parent::linkRoute($name, $title, $parameters, $attributes); }
/** * 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); } } } }