Permission::checkUrl PHP Method

checkUrl() public method

権限の必要なURLかチェックする
public checkUrl ( array $check ) : boolean
$check array チェックするURL
return boolean True if the operation should continue, false if it should abort
    public function checkUrl($check)
    {
        if (!$check[key($check)]) {
            return true;
        }
        $url = $check[key($check)];
        if (preg_match('/^[^\\/]/is', $url)) {
            $url = '/' . $url;
        }
        // ルーティング設定に合わせて変換
        $url = preg_replace('/^\\/admin\\//', '/' . Configure::read('Routing.prefixes.0') . '/', $url);
        if (preg_match('/^(\\/[a-z_]+)\\*$/is', $url, $matches)) {
            $url = $matches[1] . '/' . '*';
        }
        $params = Router::parse($url);
        if (empty($params['prefix'])) {
            return false;
        }
        return true;
    }