Defines the access controller for the custom block entity type.
Expanded class hierarchy of CustomBlockAccessController
class CustomBlockAccessController extends EntityAccessController {
/**
* {@inheritdoc}
*/
protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
if ($operation === 'view') {
return TRUE;
}
elseif (in_array($operation, array(
'create',
'update',
'delete',
))) {
return user_access('administer blocks', $account);
}
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CustomBlockAccessController:: |
protected | function |
Performs access checks. Overrides EntityAccessController:: |
|
EntityAccessController:: |
protected | property | Stores calculcated access check results. | |
EntityAccessController:: |
public | function |
Checks access to an operation on a given entity or entity translation. Overrides EntityAccessControllerInterface:: |
1 |
EntityAccessController:: |
protected | function | Tries to retrieve a previously cached access value from the static cache. | |
EntityAccessController:: |
public | function |
Clears all cached access checks. Overrides EntityAccessControllerInterface:: |
|
EntityAccessController:: |
protected | function | Statically caches whether the given user has access. |