Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / content_moderation / src / ContentModerationStateAccessControlHandler.php
1 <?php
2
3 namespace Drupal\content_moderation;
4
5 use Drupal\Core\Access\AccessResult;
6 use Drupal\Core\Session\AccountInterface;
7 use Drupal\Core\Entity\EntityAccessControlHandler;
8 use Drupal\Core\Entity\EntityInterface;
9
10 /**
11  * The access control handler for the content_moderation_state entity type.
12  *
13  * @see \Drupal\content_moderation\Entity\ContentModerationState
14  */
15 class ContentModerationStateAccessControlHandler extends EntityAccessControlHandler {
16
17   /**
18    * {@inheritdoc}
19    */
20   public function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
21     // ContentModerationState is an internal entity type. Access is denied for
22     // viewing, updating, and deleting. In order to update an entity's
23     // moderation state use its moderation_state field.
24     return AccessResult::forbidden('ContentModerationState is an internal entity type.');
25   }
26
27   /**
28    * {@inheritdoc}
29    */
30   protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
31     // ContentModerationState is an internal entity type. Access is denied for
32     // creating. In order to update an entity's moderation state use its
33     // moderation_state field.
34     return AccessResult::forbidden('ContentModerationState is an internal entity type.');
35   }
36
37 }