summaryrefslogtreecommitdiffstats
path: root/core/modules/content_moderation/content_moderation.module
diff options
context:
space:
mode:
authorLee Rowlands2017-07-20 03:15:46 (GMT)
committerLee Rowlands2017-07-20 03:15:46 (GMT)
commit930a35b962c898f42c2808a2a28f610830bf6d85 (patch)
treed6d45f810d73cd190cf9d4a51097c32c7b6d32e8 /core/modules/content_moderation/content_moderation.module
parentba0ac0fde374c2b1a1922440257015967f898b82 (diff)
Issue #2843753 by Wim Leers, amateescu: Prevent ContentModerationState from being exposed by REST's EntityResource
Diffstat (limited to 'core/modules/content_moderation/content_moderation.module')
-rw-r--r--core/modules/content_moderation/content_moderation.module10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/modules/content_moderation/content_moderation.module b/core/modules/content_moderation/content_moderation.module
index b67fbd3..0dc03bf 100644
--- a/core/modules/content_moderation/content_moderation.module
+++ b/core/modules/content_moderation/content_moderation.module
@@ -262,3 +262,13 @@ function content_moderation_workflow_insert(WorkflowInterface $entity) {
function content_moderation_workflow_update(WorkflowInterface $entity) {
content_moderation_workflow_insert($entity);
}
+
+/**
+ * Implements hook_rest_resource_alter().
+ */
+function content_moderation_rest_resource_alter(&$definitions) {
+ // ContentModerationState is an internal entity type. Therefore it should not
+ // be exposed via REST.
+ // @see \Drupal\content_moderation\ContentModerationStateAccessControlHandler
+ unset($definitions['entity:content_moderation_state']);
+}