You are here

public function ContentModerationStateAccessControlHandler::checkAccess in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/src/ContentModerationStateAccessControlHandler.php \Drupal\content_moderation\ContentModerationStateAccessControlHandler::checkAccess()
  2. 10 core/modules/content_moderation/src/ContentModerationStateAccessControlHandler.php \Drupal\content_moderation\ContentModerationStateAccessControlHandler::checkAccess()

Performs access checks.

This method is supposed to be overwritten by extending classes that do their own custom access checking.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for which to check access.

string $operation: The entity operation. Usually one of 'view', 'view label', 'update' or 'delete'.

\Drupal\Core\Session\AccountInterface $account: The user for which to check access.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

Overrides EntityAccessControlHandler::checkAccess

File

core/modules/content_moderation/src/ContentModerationStateAccessControlHandler.php, line 20

Class

ContentModerationStateAccessControlHandler
The access control handler for the content_moderation_state entity type.

Namespace

Drupal\content_moderation

Code

public function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {

  // ContentModerationState is an internal entity type. Access is denied for
  // viewing, updating, and deleting. In order to update an entity's
  // moderation state use its moderation_state field.
  return AccessResult::forbidden('ContentModerationState is an internal entity type.');
}