class ChecklistapiAccessCheck in Checklist API 8
An access check service for checklist routes.
Hierarchy
- class \Drupal\checklistapi\Access\ChecklistapiAccessCheck implements AccessInterface
Expanded class hierarchy of ChecklistapiAccessCheck
1 string reference to 'ChecklistapiAccessCheck'
1 service uses ChecklistapiAccessCheck
File
- src/
Access/ ChecklistapiAccessCheck.php, line 12
Namespace
Drupal\checklistapi\AccessView source
class ChecklistapiAccessCheck implements AccessInterface {
/**
* Checks routing access for the checklist.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The current route match.
*
* @return \Drupal\Core\Access\AccessResult
* Returns an access result.
*/
public function access(RouteMatchInterface $route_match) {
$op = $route_match
->getParameter('op') ?: 'any';
$id = $route_match
->getParameter('checklist_id');
if (!$id) {
return AccessResult::neutral();
}
return AccessResult::allowedIf(checklistapi_checklist_access($id, $op));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ChecklistapiAccessCheck:: |
public | function | Checks routing access for the checklist. |