protected function ParagraphsTypeAccessControlHandler::checkAccess

File

paragraphs/src/ParagraphsTypeAccessControlHandler.php, line 25

Class

ParagraphsTypeAccessControlHandler
Defines the access control handler for the Paragraphs type entity type.

Namespace

Drupal\paragraphs

Code

protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
  switch ($operation) {
    case 'view label':
      return AccessResult::allowedIfHasPermission($account, 'access content');
    default:
      return parent::checkAccess($entity, $operation, $account);
  }
}