public function ViewsBulkOperationsAccess::access in Views Bulk Operations (VBO) 4.0.x
Same name and namespace in other branches
- 8.3 src/Access/ViewsBulkOperationsAccess.php \Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::access()
- 8 src/Access/ViewsBulkOperationsAccess.php \Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::access()
- 8.2 src/Access/ViewsBulkOperationsAccess.php \Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::access()
A custom access check.
Parameters
\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.
\Drupal\Core\Routing\RouteMatch $routeMatch: The matched route.
File
- src/
Access/ ViewsBulkOperationsAccess.php, line 39
Class
- ViewsBulkOperationsAccess
- Defines module access rules.
Namespace
Drupal\views_bulk_operations\AccessCode
public function access(AccountInterface $account, RouteMatch $routeMatch) {
$parameters = $routeMatch
->getParameters()
->all();
if ($view = Views::getView($parameters['view_id'])) {
if ($view
->access($parameters['display_id'], $account)) {
return AccessResult::allowed();
}
}
return AccessResult::forbidden();
}