code: public function urlAllowed($user, $url) {
  		if (empty($url)) {
  			return false;
  		}
  
  		if (is_array($url)) {
  			// prevent plugin confusion
  			$url = Hash::merge([
  				'plugin' => null
  			], $url);
  
  			$url = Router::url($url);
  			// strip off the base path
  			$url = Router::normalize($url);
  		}
  		$route = Router::parse($url);
  		if (empty($route['controller']) || empty($route['action'])) {
  			return false;
  		}
  		return $this->isAuthorized($user, $route['plugin'], $route['controller'], $route['action']);
  	}
docs: Checks whether the user is allowed to access a specific URL
  
  @param array $user user to check with
  @param array|string $url url to check
  @return void