summaryrefslogtreecommitdiffstats
path: root/core/modules/content_moderation/src/Entity
diff options
context:
space:
mode:
authorAlex Pott2017-05-08 10:09:57 (GMT)
committerAlex Pott2017-05-08 10:09:57 (GMT)
commit8bedf88b63df0c08fa3fd589cdbac6ea03205b2d (patch)
treef6d7336d0acd38fa760b957f486e981265fe18c4 /core/modules/content_moderation/src/Entity
parent3b22e70c6c62a1ca5e8a27afdc69522666a33bf2 (diff)
Issue #2779931 by Sam152, alexpott, timmillwood, Wim Leers, catch, dawehner: Add storage exception that enforces unique content_entity_type_id and content_entity_id on the content moderation state content entity, and add access control handler to forbid all access
Diffstat (limited to 'core/modules/content_moderation/src/Entity')
-rw-r--r--core/modules/content_moderation/src/Entity/ContentModerationState.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/modules/content_moderation/src/Entity/ContentModerationState.php b/core/modules/content_moderation/src/Entity/ContentModerationState.php
index cb1bc1f..5b1c250 100644
--- a/core/modules/content_moderation/src/Entity/ContentModerationState.php
+++ b/core/modules/content_moderation/src/Entity/ContentModerationState.php
@@ -24,6 +24,7 @@ use Drupal\user\UserInterface;
* handlers = {
* "storage_schema" = "Drupal\content_moderation\ContentModerationStateStorageSchema",
* "views_data" = "\Drupal\views\EntityViewsData",
+ * "access" = "Drupal\content_moderation\ContentModerationStateAccessControlHandler",
* },
* base_table = "content_moderation_state",
* revision_table = "content_moderation_state_revision",
@@ -74,6 +75,7 @@ class ContentModerationState extends ContentEntityBase implements ContentModerat
->setLabel(t('Content entity type ID'))
->setDescription(t('The ID of the content entity type this moderation state is for.'))
->setRequired(TRUE)
+ ->setSetting('max_length', EntityTypeInterface::ID_MAX_LENGTH)
->setRevisionable(TRUE);
$fields['content_entity_id'] = BaseFieldDefinition::create('integer')
@@ -82,10 +84,6 @@ class ContentModerationState extends ContentEntityBase implements ContentModerat
->setRequired(TRUE)
->setRevisionable(TRUE);
- // @todo https://www.drupal.org/node/2779931 Add constraint that enforces
- // unique content_entity_type_id, content_entity_id and
- // content_entity_revision_id.
-
$fields['content_entity_revision_id'] = BaseFieldDefinition::create('integer')
->setLabel(t('Content entity revision ID'))
->setDescription(t('The revision ID of the content entity this moderation state is for.'))