isAuthorized($url)) { $linkOptions = $options; unset($linkOptions['before'], $linkOptions['after']); return Hash::get($options, 'before') . parent::link($title, $url, $linkOptions) . Hash::get($options, 'after'); } return false; } /** * Returns true if the target url is authorized for the logged in user * * @param string|array|null $url url that the user is making request. * @return bool */ public function isAuthorized($url = null) { $event = new Event(UsersAuthComponent::EVENT_IS_AUTHORIZED, $this, ['url' => $url]); $result = $this->_View->eventManager()->dispatch($event); return $result->result; } }