SimpleBlockAccessControlHandler.php in Simple Block 8
Namespace
Drupal\simple_blockFile
src/SimpleBlockAccessControlHandler.phpView source
<?php
namespace Drupal\simple_block;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityAccessControlHandler;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;
/**
* Defines the access control handler for the simple block entity type.
*
* @see \Drupal\simple_block\Entity\SimpleBlock
*/
class SimpleBlockAccessControlHandler extends EntityAccessControlHandler {
/**
* {@inheritdoc}
*/
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
return AccessResult::allowedIf($account
->hasPermission('administer blocks'));
}
}
Classes
Name | Description |
---|---|
SimpleBlockAccessControlHandler | Defines the access control handler for the simple block entity type. |