class ViewsBulkOperationsAccess 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
- 8 src/Access/ViewsBulkOperationsAccess.php \Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess
- 8.2 src/Access/ViewsBulkOperationsAccess.php \Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess
Defines module access rules.
Hierarchy
- class \Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess implements AccessInterface
Expanded class hierarchy of ViewsBulkOperationsAccess
1 string reference to 'ViewsBulkOperationsAccess'
1 service uses ViewsBulkOperationsAccess
File
- src/
Access/ ViewsBulkOperationsAccess.php, line 15
Namespace
Drupal\views_bulk_operations\AccessView source
class ViewsBulkOperationsAccess implements AccessInterface {
/**
* The tempstore service.
*
* @var \Drupal\Core\TempStore\PrivateTempStoreFactory
*/
protected $tempStoreFactory;
/**
* Object constructor.
*/
public function __construct(PrivateTempStoreFactory $tempStoreFactory) {
$this->tempStoreFactory = $tempStoreFactory;
}
/**
* A custom access check.
*
* @param \Drupal\Core\Session\AccountInterface $account
* Run access checks for this account.
* @param \Drupal\Core\Routing\RouteMatch $routeMatch
* The matched route.
*/
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();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ViewsBulkOperationsAccess:: |
protected | property | The tempstore service. | |
ViewsBulkOperationsAccess:: |
public | function | A custom access check. | |
ViewsBulkOperationsAccess:: |
public | function | Object constructor. |