class PageAccessCheck in Page Manager 8
Same name and namespace in other branches
- 8.4 src/Entity/PageAccessCheck.php \Drupal\page_manager\Entity\PageAccessCheck
Mimics the generic entity access but with a custom key to prevent collisions.
Hierarchy
- class \Drupal\Core\Entity\EntityAccessCheck implements AccessInterface
- class \Drupal\page_manager\Entity\PageAccessCheck
Expanded class hierarchy of PageAccessCheck
1 string reference to 'PageAccessCheck'
1 service uses PageAccessCheck
File
- src/
Entity/ PageAccessCheck.php, line 18 - Contains \Drupal\page_manager\Entity\PageAccessCheck.
Namespace
Drupal\page_manager\EntityView source
class PageAccessCheck extends EntityAccessCheck {
/**
* {@inheritdoc}
*/
public function access(Route $route, RouteMatchInterface $route_match, AccountInterface $account) {
// Backup the original requirements.
$original_requirements = $route
->getRequirements();
// Replace it with our entity access value and run the parent access check.
$route
->setRequirement('_entity_access', $route
->getRequirement('_page_access'));
$access = parent::access($route, $route_match, $account);
// Restore the original requirements.
$route
->setRequirements($original_requirements);
return $access;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PageAccessCheck:: |
public | function |
Checks access to the entity operation on the given route. Overrides EntityAccessCheck:: |