isAuthorized($url)) { 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 = EventManager::instance()->dispatch($event); return $result->result; } }