Checks access for text formats.
Expanded class hierarchy of FilterAccessCheck
class FilterAccessCheck implements AccessCheckInterface {
/**
* {@inheritdoc}
*/
public function applies(Route $route) {
return array_key_exists('_filter_access', $route
->getRequirements());
}
/**
* {@inheritdoc}
*/
public function access(Route $route, Request $request) {
if ($format = $request->attributes
->get('filter_format')) {
// Handle special cases up front. All users have access to the fallback
// format.
if ($format->format == filter_fallback_format()) {
return TRUE;
}
// Check the permission if one exists; otherwise, we have a non-existent
// format so we return FALSE.
$permission = filter_permission_name($format);
return !empty($permission) && user_access($permission);
}
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AccessCheckInterface:: |
constant | Grant access. | ||
AccessCheckInterface:: |
constant | Deny access. | ||
AccessCheckInterface:: |
constant | Block access. | ||
FilterAccessCheck:: |
public | function |
Checks for access to route. Overrides AccessCheckInterface:: |
|
FilterAccessCheck:: |
public | function |
Declares whether the access check applies to a specific route or not. Overrides AccessCheckInterface:: |