diff core/modules/editor/src/EditorAccessControlHandler.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/editor/src/EditorAccessControlHandler.php	Thu Jul 05 14:24:15 2018 +0000
@@ -0,0 +1,24 @@
+<?php
+
+namespace Drupal\editor;
+
+use Drupal\Core\Entity\EntityAccessControlHandler;
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Session\AccountInterface;
+
+/**
+ * Defines the access control handler for the text editor entity type.
+ *
+ * @see \Drupal\editor\Entity\Editor
+ */
+class EditorAccessControlHandler extends EntityAccessControlHandler {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function checkAccess(EntityInterface $editor, $operation, AccountInterface $account) {
+    /** @var \Drupal\editor\EditorInterface $editor */
+    return $editor->getFilterFormat()->access($operation, $account, TRUE);
+  }
+
+}