protected function checkAccess(Request
$request) { // The cacheability (if any) of this request's access check result must be
// applied to the response.
$access_result =
$this->accessManager->
checkRequest($request,
$this->account, TRUE
);
// Allow a master request to set the access result for a subrequest: if an
// access result attribute is already set, don't overwrite it.
if (!
$request->attributes->
has(AccessAwareRouterInterface::ACCESS_RESULT
)) { $request->attributes->
set(AccessAwareRouterInterface::ACCESS_RESULT,
$access_result);
} if (!
$access_result->
isAllowed()) { if ($access_result instanceof CacheableDependencyInterface &&
$request->
isMethodCacheable()) { throw new CacheableAccessDeniedHttpException($access_result,
$access_result instanceof AccessResultReasonInterface ?
$access_result->
getReason() : ''
);
} else { throw new AccessDeniedHttpException($access_result instanceof AccessResultReasonInterface ?
$access_result->
getReason() : ''
);
} } } /**
* {@inheritdoc}
*/