diff --git a/core/includes/entity.inc b/core/includes/entity.inc index 67b3738649f0fe2e46f25a4e74b6dafc94c24373..40ef0e9d05e6e8a70aa0b8605d0ffe8b71242a02 100644 --- a/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -313,25 +313,6 @@ function entity_page_label(EntityInterface $entity, $langcode = NULL) { return $entity->label($langcode); } -/** - * Returns the entity access controller for the given entity type. - * - * @param string $entity_type - * The type of the entity. - * - * @return \Drupal\Core\Entity\EntityAccessControllerInterface - * An entity access controller instance. - * - * @see \Drupal\Core\Entity\EntityManagerInterface::getAccessController(). - * - * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0. - * Use \Drupal::entityManager()->getAccessController(). - */ -function entity_access_controller($entity_type) { - return \Drupal::entityManager() - ->getAccessController($entity_type); -} - /** * Returns the render array for an entity. * diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php index fa2c47217dd82b9c97e046bcdcd2581d8177f4ca..dcaebc7cdf6958d11d887c4464eacdb1104bb8d1 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -550,11 +550,11 @@ public function isEmpty() { public function access($operation, AccountInterface $account = NULL) { if ($operation == 'create') { return $this->entityManager() - ->getAccessController($this->entityTypeId) + ->getAccessControlHandler($this->entityTypeId) ->createAccess($this->bundle(), $account); } return $this->entityManager() - ->getAccessController($this->entityTypeId) + ->getAccessControlHandler($this->entityTypeId) ->access($this, $operation, $this->activeLangcode, $account); } diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index cf18d55408bb34766edc46cfb88ccb49d8c1f69f..452f8c7100bdb79dfff2c666a1e1f4f4f1006795 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -280,11 +280,11 @@ public function uriRelationships() { public function access($operation, AccountInterface $account = NULL) { if ($operation == 'create') { return $this->entityManager() - ->getAccessController($this->entityTypeId) + ->getAccessControlHandler($this->entityTypeId) ->createAccess($this->bundle(), $account); } return $this->entityManager() - ->getAccessController($this->entityTypeId) + ->getAccessControlHandler($this->entityTypeId) ->access($this, $operation, LanguageInterface::LANGCODE_DEFAULT, $account); } diff --git a/core/lib/Drupal/Core/Entity/EntityAccessController.php b/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php similarity index 93% rename from core/lib/Drupal/Core/Entity/EntityAccessController.php rename to core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php index f20ef9c89325cd582763acd4348d321433d15855..e4712e55189b9f4f11b2aa53953e496059bbb829 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessController.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php @@ -2,32 +2,30 @@ /** * @file - * Contains \Drupal\Core\Entity\EntityAccessController. + * Contains \Drupal\Core\Entity\EntityAccessControlHandler. */ namespace Drupal\Core\Entity; -use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldItemListInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Session\AccountInterface; /** - * Defines a default implementation for entity access controllers. + * Defines a default implementation for entity access control handler. */ -class EntityAccessController extends EntityControllerBase implements EntityAccessControllerInterface { +class EntityAccessControlHandler extends EntityControllerBase implements EntityAccessControlHandlerInterface { /** - * Stores calculcated access check results. + * Stores calculated access check results. * * @var array */ protected $accessCache = array(); /** - * The entity type ID of the access controller instance. + * The entity type ID of the access control handler instance. * * @var string */ @@ -41,7 +39,7 @@ class EntityAccessController extends EntityControllerBase implements EntityAcces protected $entityType; /** - * Constructs an access controller instance. + * Constructs an access control handler instance. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. @@ -64,7 +62,7 @@ public function access(EntityInterface $entity, $operation, $langcode = Language // Invoke hook_entity_access() and hook_ENTITY_TYPE_access(). Hook results // take precedence over overridden implementations of - // EntityAccessController::checkAccess(). Entities that have checks that + // EntityAccessControlHandler::checkAccess(). Entities that have checks that // need to be done before the hook is invoked should do so by overriding // this method. @@ -78,7 +76,7 @@ public function access(EntityInterface $entity, $operation, $langcode = Language if (($return = $this->processAccessHookResults($access)) === NULL) { // No module had an opinion about the access, so let's the access - // controller check create access. + // handler check create access. $return = (bool) $this->checkAccess($entity, $operation, $langcode, $account); } return $this->setCache($return, $entity->uuid(), $operation, $langcode, $account); @@ -214,7 +212,7 @@ public function createAccess($entity_bundle = NULL, AccountInterface $account = // Invoke hook_entity_create_access() and hook_ENTITY_TYPE_create_access(). // Hook results take precedence over overridden implementations of - // EntityAccessController::checkAccess(). Entities that have checks that + // EntityAccessControlHandler::checkAccess(). Entities that have checks that // need to be done before the hook is invoked should do so by overriding // this method. @@ -228,7 +226,7 @@ public function createAccess($entity_bundle = NULL, AccountInterface $account = if (($return = $this->processAccessHookResults($access)) === NULL) { // No module had an opinion about the access, so let's the access - // controller check create access. + // handler check create access. $return = (bool) $this->checkCreateAccess($account, $context, $entity_bundle); } return $this->setCache($return, $cid, 'create', $context['langcode'], $account); diff --git a/core/lib/Drupal/Core/Entity/EntityAccessControllerInterface.php b/core/lib/Drupal/Core/Entity/EntityAccessControlHandlerInterface.php similarity index 87% rename from core/lib/Drupal/Core/Entity/EntityAccessControllerInterface.php rename to core/lib/Drupal/Core/Entity/EntityAccessControlHandlerInterface.php index 2a5851fbe4a239746c30420ef21a1731236d65c8..52c1b7b60541e9de848e0f97f4eb01ec0ab262c4 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessControllerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessControlHandlerInterface.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Entity\EntityAccessControllerInterface. + * Contains \Drupal\Core\Entity\EntityAccessControlHandlerInterface. */ namespace Drupal\Core\Entity; @@ -14,14 +14,14 @@ use Drupal\Core\Session\AccountInterface; /** - * Defines a common interface for entity access controller classes. + * Defines a common interface for entity access control handlers. */ -interface EntityAccessControllerInterface { +interface EntityAccessControlHandlerInterface { /** * Checks access to an operation on a given entity or entity translation. * - * Use \Drupal\Core\Entity\EntityAccessControllerInterface::createAccess() + * Use \Drupal\Core\Entity\EntityAccessControlHandlerInterface::createAccess() * to check access to create an entity. * * @param \Drupal\Core\Entity\EntityInterface $entity @@ -62,7 +62,7 @@ public function createAccess($entity_bundle = NULL, AccountInterface $account = public function resetCache(); /** - * Sets the module handler for this access controller. + * Sets the module handler for this access control handler. * * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. @@ -77,7 +77,7 @@ public function setModuleHandler(ModuleHandlerInterface $module_handler); * This method does not determine whether access is granted to the entity * itself, only the specific field. Callers are responsible for ensuring that * entity access is also respected, for example by using - * \Drupal\Core\Entity\EntityAccessControllerInterface::access(). + * \Drupal\Core\Entity\EntityAccessControlHandlerInterface::access(). * * @param string $operation * The operation access should be checked for. @@ -92,7 +92,7 @@ public function setModuleHandler(ModuleHandlerInterface $module_handler); * is checked for the field definition, without any specific value * available. Defaults to NULL. * - * @see \Drupal\Core\Entity\EntityAccessControllerInterface::access() + * @see \Drupal\Core\Entity\EntityAccessControlHandlerInterface::access() */ public function fieldAccess($operation, FieldDefinitionInterface $field_definition, AccountInterface $account = NULL, FieldItemListInterface $items = NULL); diff --git a/core/lib/Drupal/Core/Entity/EntityCreateAccessCheck.php b/core/lib/Drupal/Core/Entity/EntityCreateAccessCheck.php index bf7073d87e4d1c3016b6c2ccc40a132ca95bd0dd..e3fab39f14afb6e164db2a941fb7c9a90c98de2c 100644 --- a/core/lib/Drupal/Core/Entity/EntityCreateAccessCheck.php +++ b/core/lib/Drupal/Core/Entity/EntityCreateAccessCheck.php @@ -69,7 +69,7 @@ public function access(Route $route, Request $request, AccountInterface $account return static::DENY; } } - return $this->entityManager->getAccessController($entity_type)->createAccess($bundle, $account) ? static::ALLOW : static::DENY; + return $this->entityManager->getAccessControlHandler($entity_type)->createAccess($bundle, $account) ? static::ALLOW : static::DENY; } } diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index f0e90e3b1fc2e7b4273d9f70e1dd4d4c21c0239c..c827494e0db5c9cf38fa945087c6d5f0eb0bf0c8 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -271,8 +271,8 @@ public function getViewBuilder($entity_type) { /** * {@inheritdoc} */ - public function getAccessController($entity_type) { - return $this->getController($entity_type, 'access', 'getAccessClass'); + public function getAccessControlHandler($entity_type) { + return $this->getController($entity_type, 'access', 'getAccessControlClass'); } /** diff --git a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php index 8f4fc27e6a4ad7d5715c442cb9dde6890988e0c2..e4d6b051c11f17d6d05f821117e9d729537126f8 100644 --- a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php @@ -106,15 +106,15 @@ public function getFieldMap(); public function getFieldMapByFieldType($field_type); /** - * Creates a new access controller instance. + * Creates a new access control handler instance. * * @param string $entity_type - * The entity type for this access controller. + * The entity type for this access control handler. * - * @return \Drupal\Core\Entity\EntityAccessControllerInterface. - * A access controller instance. + * @return \Drupal\Core\Entity\EntityAccessControlHandlerInterface. + * A access control handler instance. */ - public function getAccessController($entity_type); + public function getAccessControlHandler($entity_type); /** * Returns the route information for an entity type's bundle. diff --git a/core/lib/Drupal/Core/Entity/EntityType.php b/core/lib/Drupal/Core/Entity/EntityType.php index 5ebb0b655dbab9ef49f7af0645ea72f9a1fc92fc..ca245055d86f0f6e60a71aab6f7eba1edc8bb82c 100644 --- a/core/lib/Drupal/Core/Entity/EntityType.php +++ b/core/lib/Drupal/Core/Entity/EntityType.php @@ -224,7 +224,7 @@ public function __construct($definition) { 'bundle' => '' ); $this->controllers += array( - 'access' => 'Drupal\Core\Entity\EntityAccessController', + 'access' => 'Drupal\Core\Entity\EntityAccessControlHandler', ); } @@ -446,7 +446,7 @@ public function hasViewBuilderClass() { /** * {@inheritdoc} */ - public function getAccessClass() { + public function getAccessControlClass() { return $this->getControllerClass('access'); } diff --git a/core/lib/Drupal/Core/Entity/EntityTypeInterface.php b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php index d92e00b0cf469aa652054c673599cba75e021b2c..c4b0496e0676f60ac399ba884b629daa76b7038a 100644 --- a/core/lib/Drupal/Core/Entity/EntityTypeInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php @@ -208,8 +208,8 @@ public function getControllerClass($controller_type); * - render: The name of the class that is used to render the entities. The * class must implement \Drupal\Core\Entity\EntityViewBuilderInterface. * - access: The name of the class that is used for access checks. The class - * must implement \Drupal\Core\Entity\EntityAccessControllerInterface. - * Defaults to \Drupal\Core\Entity\EntityAccessController. + * must implement \Drupal\Core\Entity\EntityAccessControlHandlerInterface. + * Defaults to \Drupal\Core\Entity\EntityAccessControlHandler. */ public function getControllerClasses(); @@ -320,12 +320,12 @@ public function setViewBuilderClass($class); public function hasViewBuilderClass(); /** - * Returns the access class. + * Returns the access control class. * * @return string - * The class for this entity type's access. + * The class for this entity type's access control. */ - public function getAccessClass(); + public function getAccessControlClass(); /** * Returns the access class. @@ -363,7 +363,7 @@ public function setControllerClass($controller_type, $value); /** * Returns the name of the default administrative permission. * - * The default \Drupal\Core\Entity\EntityAccessController class checks this + * The default \Drupal\Core\Entity\EntityAccessControlHandler class checks this * permission for all operations in its checkAccess() method. Entities with * more complex permissions can extend this class to do their own access * checks. diff --git a/core/lib/Drupal/Core/Field/FieldItemList.php b/core/lib/Drupal/Core/Field/FieldItemList.php index 726572fdcd7181bf37ac2b0dc87a6485355296a2..7f0890d8a12095893efe569ed5cb7317eb094c91 100644 --- a/core/lib/Drupal/Core/Field/FieldItemList.php +++ b/core/lib/Drupal/Core/Field/FieldItemList.php @@ -188,8 +188,8 @@ public function __unset($property_name) { * {@inheritdoc} */ public function access($operation = 'view', AccountInterface $account = NULL) { - $access_controller = \Drupal::entityManager()->getAccessController($this->getEntity()->getEntityTypeId()); - return $access_controller->fieldAccess($operation, $this->getFieldDefinition(), $account, $this); + $access_control_handler = \Drupal::entityManager()->getAccessControlHandler($this->getEntity()->getEntityTypeId()); + return $access_control_handler->fieldAccess($operation, $this->getFieldDefinition(), $account, $this); } /** diff --git a/core/lib/Drupal/Core/Field/FieldItemListInterface.php b/core/lib/Drupal/Core/Field/FieldItemListInterface.php index ddfe26b78f646574717de291c84623789b595832..402aa193e25246c4014cb69e78e33062dc2ae37b 100644 --- a/core/lib/Drupal/Core/Field/FieldItemListInterface.php +++ b/core/lib/Drupal/Core/Field/FieldItemListInterface.php @@ -84,7 +84,7 @@ public function getSetting($setting_name); /** * Contains the default access logic of this field. * - * See \Drupal\Core\Entity\EntityAccessControllerInterface::fieldAccess() for + * See \Drupal\Core\Entity\EntityAccessControlHandlerInterface::fieldAccess() for * the parameter documentation. * * @return bool diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php index 542b47c10d720992c9b003fb3bfbaf2570d8acce..a01a055e832f337f9e4c27aab755d39b10ee3c09 100644 --- a/core/modules/aggregator/src/Entity/Feed.php +++ b/core/modules/aggregator/src/Entity/Feed.php @@ -23,7 +23,7 @@ * controllers = { * "storage" = "Drupal\aggregator\FeedStorage", * "view_builder" = "Drupal\aggregator\FeedViewBuilder", - * "access" = "Drupal\aggregator\FeedAccessController", + * "access" = "Drupal\aggregator\FeedAccessControlHandler", * "form" = { * "default" = "Drupal\aggregator\FeedForm", * "delete" = "Drupal\aggregator\Form\FeedDeleteForm", diff --git a/core/modules/aggregator/src/Entity/Item.php b/core/modules/aggregator/src/Entity/Item.php index f51350105ab3c59748361f6159e685c18c417f46..84244b42d918ddecb2e9f8d9c697e1adef779862 100644 --- a/core/modules/aggregator/src/Entity/Item.php +++ b/core/modules/aggregator/src/Entity/Item.php @@ -24,7 +24,7 @@ * controllers = { * "storage" = "Drupal\aggregator\ItemStorage", * "view_builder" = "Drupal\aggregator\ItemViewBuilder", - * "access" = "Drupal\aggregator\FeedAccessController", + * "access" = "Drupal\aggregator\FeedAccessControlHandler", * }, * uri_callback = "Drupal\aggregator\Entity\Item::buildUri", * base_table = "aggregator_item", diff --git a/core/modules/aggregator/src/FeedAccessController.php b/core/modules/aggregator/src/FeedAccessControlHandler.php similarity index 76% rename from core/modules/aggregator/src/FeedAccessController.php rename to core/modules/aggregator/src/FeedAccessControlHandler.php index 73ad32c9f4370f5340ac0a2baef18a3e7c4deaf2..9683ad5f68d9532872714df8bb30d60fb181cd7d 100644 --- a/core/modules/aggregator/src/FeedAccessController.php +++ b/core/modules/aggregator/src/FeedAccessControlHandler.php @@ -2,21 +2,21 @@ /** * @file - * Contains \Drupal\aggregator\FeedAccessController. + * Contains \Drupal\aggregator\FeedAccessControlHandler. */ namespace Drupal\aggregator; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; /** - * Defines an access controller for the feed entity. + * Defines an access control handler for the feed entity. * * @see \Drupal\aggregator\Entity\Feed */ -class FeedAccessController extends EntityAccessController { +class FeedAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/block/block.api.php b/core/modules/block/block.api.php index f43d984f4cdea3daa4ba95150c4b4fbfa7efba17..a33aaa9204d29b1356e10659e3dfd88c30ed4f16 100644 --- a/core/modules/block/block.api.php +++ b/core/modules/block/block.api.php @@ -142,10 +142,10 @@ function hook_block_view_BASE_BLOCK_ID_alter(array &$build, \Drupal\block\BlockP * @return bool|null * FALSE denies access. TRUE allows access unless another module returns * FALSE. If all modules return NULL, then default access rules from - * \Drupal\block\BlockAccessController::checkAccess() are used. + * \Drupal\block\BlockAccessControlHandler::checkAccess() are used. * - * @see \Drupal\Core\Entity\EntityAccessController::access() - * @see \Drupal\block\BlockAccessController::checkAccess() + * @see \Drupal\Core\Entity\EntityAccessControlHandler::access() + * @see \Drupal\block\BlockAccessControlHandler::checkAccess() * @ingroup block_api */ function hook_block_access(\Drupal\block\Entity\Block $block, $operation, \Drupal\user\Entity\User $account, $langcode) { diff --git a/core/modules/block/src/BlockAccessController.php b/core/modules/block/src/BlockAccessControlHandler.php similarity index 69% rename from core/modules/block/src/BlockAccessController.php rename to core/modules/block/src/BlockAccessControlHandler.php index 0089470968d486f9f0fd2e6565bcdc719e2d8767..2768d884ae319a980bd60a1bd82a66a7cc0da6ec 100644 --- a/core/modules/block/src/BlockAccessController.php +++ b/core/modules/block/src/BlockAccessControlHandler.php @@ -2,19 +2,21 @@ /** * @file - * Contains \Drupal\block\BlockAccessController. + * Contains \Drupal\block\BlockAccessControlHandler. */ namespace Drupal\block; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; /** - * Provides a Block access controller. + * Defines the access control handler for the block entity type. + * + * @see \Drupal\block\Entity\Block */ -class BlockAccessController extends EntityAccessController { +class BlockAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/block/src/BlockPluginInterface.php b/core/modules/block/src/BlockPluginInterface.php index 05d0ce59359f3b519c6fe6cd372d13287a1f3bac..de13fe82414c2cbc19528b212977bff0789378c1 100644 --- a/core/modules/block/src/BlockPluginInterface.php +++ b/core/modules/block/src/BlockPluginInterface.php @@ -51,7 +51,7 @@ public function label(); * @return bool * TRUE if the block should be shown, or FALSE otherwise. * - * @see \Drupal\block\BlockAccessController + * @see \Drupal\block\BlockAccessControlHandler */ public function access(AccountInterface $account); diff --git a/core/modules/block/src/Entity/Block.php b/core/modules/block/src/Entity/Block.php index 486afb83291c18f3fa7620a19c36270864f84c47..afd569703ed7776142d99e0c69cd52184c8d8b90 100644 --- a/core/modules/block/src/Entity/Block.php +++ b/core/modules/block/src/Entity/Block.php @@ -22,7 +22,7 @@ * id = "block", * label = @Translation("Block"), * controllers = { - * "access" = "Drupal\block\BlockAccessController", + * "access" = "Drupal\block\BlockAccessControlHandler", * "view_builder" = "Drupal\block\BlockViewBuilder", * "list_builder" = "Drupal\block\BlockListBuilder", * "form" = { diff --git a/core/modules/block_content/src/BlockContentAccessController.php b/core/modules/block_content/src/BlockContentAccessControlHandler.php similarity index 57% rename from core/modules/block_content/src/BlockContentAccessController.php rename to core/modules/block_content/src/BlockContentAccessControlHandler.php index 5709498bb5f5d89c217e4e9ab4260d690d150f4a..6b4de2313bb14b8abccf0685d8e4b14d71bd42d8 100644 --- a/core/modules/block_content/src/BlockContentAccessController.php +++ b/core/modules/block_content/src/BlockContentAccessControlHandler.php @@ -2,19 +2,21 @@ /** * @file - * Contains \Drupal\block_content\BlockContentAccessController. + * Contains \Drupal\block_content\BlockContentAccessControlHandler. */ namespace Drupal\block_content; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Session\AccountInterface; /** - * Defines the access controller for the custom block entity type. + * Defines the access control handler for the custom block entity type. + * + * @see \Drupal\block_content\Entity\BlockContent */ -class BlockContentAccessController extends EntityAccessController { +class BlockContentAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/block_content/src/Entity/BlockContent.php b/core/modules/block_content/src/Entity/BlockContent.php index bb4190c3da7a7cff4d71bc2949e3bf3f923a626b..c8256205cdbf986abb8c03db6dc063bd35651a9f 100644 --- a/core/modules/block_content/src/Entity/BlockContent.php +++ b/core/modules/block_content/src/Entity/BlockContent.php @@ -22,7 +22,7 @@ * bundle_label = @Translation("Custom Block type"), * controllers = { * "storage" = "Drupal\block_content\BlockContentStorage", - * "access" = "Drupal\block_content\BlockContentAccessController", + * "access" = "Drupal\block_content\BlockContentAccessControlHandler", * "list_builder" = "Drupal\block_content\BlockContentListBuilder", * "view_builder" = "Drupal\block_content\BlockContentViewBuilder", * "form" = { diff --git a/core/modules/book/book.module b/core/modules/book/book.module index f98978ada61874f6780322abfc4fdc3ebc36318f..f5ca37ff2ae43ed783149fd0bb814cc227e80dca 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -124,8 +124,8 @@ function book_node_links_alter(array &$node_links, NodeInterface $node, array &$ if (isset($node->book['depth'])) { if ($context['view_mode'] == 'full' && node_is_page($node)) { $child_type = \Drupal::config('book.settings')->get('child_type'); - $access_controller = \Drupal::entityManager()->getAccessController('node'); - if (($account->hasPermission('add content to books') || $account->hasPermission('administer book outlines')) && $access_controller->createAccess($child_type) && $node->isPublished() && $node->book['depth'] < BookManager::BOOK_MAX_DEPTH) { + $access_control_handler = \Drupal::entityManager()->getAccessControlHandler('node'); + if (($account->hasPermission('add content to books') || $account->hasPermission('administer book outlines')) && $access_control_handler->createAccess($child_type) && $node->isPublished() && $node->book['depth'] < BookManager::BOOK_MAX_DEPTH) { $links['book_add_child'] = array( 'title' => t('Add child page'), 'href' => 'node/add/' . $child_type, diff --git a/core/modules/comment/src/CommentAccessController.php b/core/modules/comment/src/CommentAccessControlHandler.php similarity index 82% rename from core/modules/comment/src/CommentAccessController.php rename to core/modules/comment/src/CommentAccessControlHandler.php index d741d864a33d6a3c6bf03fd499646f1a0ae6ae0b..77367ab9336a7f7679b51e0ca311a22304f4d666 100644 --- a/core/modules/comment/src/CommentAccessController.php +++ b/core/modules/comment/src/CommentAccessControlHandler.php @@ -2,21 +2,21 @@ /** * @file - * Contains \Drupal\comment\CommentAccessController + * Contains \Drupal\comment\CommentAccessControlHandler. */ namespace Drupal\comment; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; /** - * Access controller for the comment entity. + * Defines the access control handler for the comment entity type. * - * @see \Drupal\comment\Entity\Comment. + * @see \Drupal\comment\Entity\Comment */ -class CommentAccessController extends EntityAccessController { +class CommentAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php index fbc95b0596637a0741cffe9e43de4597026f50cd..3d3c42ff922b8276211e187d0d6572eae1da6311 100644 --- a/core/modules/comment/src/Entity/Comment.php +++ b/core/modules/comment/src/Entity/Comment.php @@ -25,7 +25,7 @@ * bundle_label = @Translation("Content type"), * controllers = { * "storage" = "Drupal\comment\CommentStorage", - * "access" = "Drupal\comment\CommentAccessController", + * "access" = "Drupal\comment\CommentAccessControlHandler", * "view_builder" = "Drupal\comment\CommentViewBuilder", * "form" = { * "default" = "Drupal\comment\CommentForm", diff --git a/core/modules/config/tests/config_test/src/ConfigTestAccessController.php b/core/modules/config/tests/config_test/src/ConfigTestAccessControlHandler.php similarity index 60% rename from core/modules/config/tests/config_test/src/ConfigTestAccessController.php rename to core/modules/config/tests/config_test/src/ConfigTestAccessControlHandler.php index fee7966409261871eb8f503571fd0caeb2943e6a..0814dd8e6f231d5bee5dab8905f324738b823f54 100644 --- a/core/modules/config/tests/config_test/src/ConfigTestAccessController.php +++ b/core/modules/config/tests/config_test/src/ConfigTestAccessControlHandler.php @@ -2,19 +2,21 @@ /** * @file - * Contains \Drupal\config_test\ConfigTestAccessController. + * Contains \Drupal\config_test\ConfigTestAccessControlHandler. */ namespace Drupal\config_test; use Drupal\Core\Session\AccountInterface; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; /** - * Defines the access controller for the config_test entity type. + * Defines the access control handler for the config_test entity type. + * + * @see \Drupal\config_test\Entity\ConfigTest */ -class ConfigTestAccessController extends EntityAccessController { +class ConfigTestAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php index 646f2c05f60b45fddacf9758dd26875db4e4e143..36f7a695fa49b85bffecd5034458dc5f8a2b875f 100644 --- a/core/modules/config/tests/config_test/src/Entity/ConfigTest.php +++ b/core/modules/config/tests/config_test/src/Entity/ConfigTest.php @@ -25,7 +25,7 @@ * "default" = "Drupal\config_test\ConfigTestForm", * "delete" = "Drupal\config_test\Form\ConfigTestDeleteForm" * }, - * "access" = "Drupal\config_test\ConfigTestAccessController" + * "access" = "Drupal\config_test\ConfigTestAccessControlHandler" * }, * config_prefix = "dynamic", * entity_keys = { diff --git a/core/modules/contact/src/CategoryAccessController.php b/core/modules/contact/src/CategoryAccessControlHandler.php similarity index 74% rename from core/modules/contact/src/CategoryAccessController.php rename to core/modules/contact/src/CategoryAccessControlHandler.php index f798d7980f3ddc7172a27c128a45734805853243..87d9f1ca5d1c3d7db3d1a439a41f37d19ea92511 100644 --- a/core/modules/contact/src/CategoryAccessController.php +++ b/core/modules/contact/src/CategoryAccessControlHandler.php @@ -2,21 +2,21 @@ /** * @file - * Contains \Drupal\contact\CategoryAccessController. + * Contains \Drupal\contact\CategoryAccessControlHandler. */ namespace Drupal\contact; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; /** - * Defines an access controller for the contact category entity. + * Defines the access control handler for the contact category entity type. * - * @see \Drupal\contact\Entity\Category. + * @see \Drupal\contact\Entity\Category */ -class CategoryAccessController extends EntityAccessController { +class CategoryAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/contact/src/Entity/Category.php b/core/modules/contact/src/Entity/Category.php index 021456d6786446573c329bb3d506b6de35b86032..ec770e47b4478457dc7fe624c9630741912caaa9 100644 --- a/core/modules/contact/src/Entity/Category.php +++ b/core/modules/contact/src/Entity/Category.php @@ -19,7 +19,7 @@ * id = "contact_category", * label = @Translation("Contact category"), * controllers = { - * "access" = "Drupal\contact\CategoryAccessController", + * "access" = "Drupal\contact\CategoryAccessControlHandler", * "list_builder" = "Drupal\contact\CategoryListBuilder", * "form" = { * "add" = "Drupal\contact\CategoryForm", diff --git a/core/modules/content_translation/src/ContentTranslationHandler.php b/core/modules/content_translation/src/ContentTranslationHandler.php index b1b7cc079b3e4c1199c60c99c32dfb18ede39c9e..d2267dee8d557812fc9ab178983161116971f9a0 100644 --- a/core/modules/content_translation/src/ContentTranslationHandler.php +++ b/core/modules/content_translation/src/ContentTranslationHandler.php @@ -60,7 +60,7 @@ public function retranslate(EntityInterface $entity, $langcode = NULL) { * {@inheritdoc} */ public function getTranslationAccess(EntityInterface $entity, $op) { - // @todo Move this logic into a translation access controller checking also + // @todo Move this logic into a translation access control handler checking also // the translation language and the given account. $entity_type = $entity->getEntityType(); $translate_permission = TRUE; diff --git a/core/modules/entity_reference/src/EntityReferenceController.php b/core/modules/entity_reference/src/EntityReferenceController.php index 2383ba6b82f1bde7d60beb7327898ea76d46416f..026b5d5caf7a7580de6c111da5a0e97b793a5f63 100644 --- a/core/modules/entity_reference/src/EntityReferenceController.php +++ b/core/modules/entity_reference/src/EntityReferenceController.php @@ -78,8 +78,8 @@ public function handleAutocomplete(Request $request, $type, $field_name, $entity } $field_definition = $definitions[$field_name]; - $access_controller = $this->entityManager()->getAccessController($entity_type); - if ($field_definition->getType() != 'entity_reference' || !$access_controller->fieldAccess('edit', $field_definition)) { + $access_control_handler = $this->entityManager()->getAccessControlHandler($entity_type); + if ($field_definition->getType() != 'entity_reference' || !$access_control_handler->fieldAccess('edit', $field_definition)) { throw new AccessDeniedHttpException(); } diff --git a/core/modules/field/src/Entity/FieldInstanceConfig.php b/core/modules/field/src/Entity/FieldInstanceConfig.php index 2b8fac0f020e89769a0f2b651641371084a51d92..fb39fca2939b230f2ed0dee5f6eac91edb88db5e 100644 --- a/core/modules/field/src/Entity/FieldInstanceConfig.php +++ b/core/modules/field/src/Entity/FieldInstanceConfig.php @@ -24,7 +24,7 @@ * id = "field_instance_config", * label = @Translation("Field instance"), * controllers = { - * "access" = "Drupal\field\FieldInstanceConfigAccessController", + * "access" = "Drupal\field\FieldInstanceConfigAccessControlHandler", * "storage" = "Drupal\field\FieldInstanceConfigStorage" * }, * config_prefix = "instance", diff --git a/core/modules/field/src/FieldInstanceConfigAccessController.php b/core/modules/field/src/FieldInstanceConfigAccessControlHandler.php similarity index 59% rename from core/modules/field/src/FieldInstanceConfigAccessController.php rename to core/modules/field/src/FieldInstanceConfigAccessControlHandler.php index 1146e1b1224274aef164eb0210fa9110f0913441..6b21783426286d6f8165c40115402603cfc5fde2 100644 --- a/core/modules/field/src/FieldInstanceConfigAccessController.php +++ b/core/modules/field/src/FieldInstanceConfigAccessControlHandler.php @@ -2,19 +2,21 @@ /** * @file - * Contains \Drupal\field\FieldInstanceConfigAccessController. + * Contains \Drupal\field\FieldInstanceConfigAccessControlHandler. */ namespace Drupal\field; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; /** - * Defines the access controller for the field instance entity type. + * Defines the access control handler for the field instance entity type. + * + * @see \Drupal\field\Entity\FieldInstanceConfig */ -class FieldInstanceConfigAccessController extends EntityAccessController { +class FieldInstanceConfigAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/field/src/Plugin/views/field/Field.php b/core/modules/field/src/Plugin/views/field/Field.php index e4103f38f73a8f5e4b067bbea5c1126f29bcce1c..b7280bd7bbc9720a5022ef9a51622a5c4976a5e4 100644 --- a/core/modules/field/src/Plugin/views/field/Field.php +++ b/core/modules/field/src/Plugin/views/field/Field.php @@ -213,8 +213,8 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o */ public function access(AccountInterface $account) { $base_table = $this->get_base_table(); - $access_controller = $this->entityManager->getAccessController($this->definition['entity_tables'][$base_table]); - return $access_controller->fieldAccess('view', $this->getFieldDefinition(), $account); + $access_control_handler = $this->entityManager->getAccessControlHandler($this->definition['entity_tables'][$base_table]); + return $access_control_handler->fieldAccess('view', $this->getFieldDefinition(), $account); } /** diff --git a/core/modules/file/src/Entity/File.php b/core/modules/file/src/Entity/File.php index 59a542103d3f4b735cb743398f97882fa9033020..8f2bb271e77b52767e56552d375bef19a0e631e0 100644 --- a/core/modules/file/src/Entity/File.php +++ b/core/modules/file/src/Entity/File.php @@ -23,7 +23,7 @@ * label = @Translation("File"), * controllers = { * "storage" = "Drupal\file\FileStorage", - * "access" = "Drupal\file\FileAccessController", + * "access" = "Drupal\file\FileAccessControlHandler", * "view_builder" = "Drupal\Core\Entity\EntityViewBuilder" * }, * base_table = "file_managed", diff --git a/core/modules/file/src/FileAccessController.php b/core/modules/file/src/FileAccessControlHandler.php similarity index 87% rename from core/modules/file/src/FileAccessController.php rename to core/modules/file/src/FileAccessControlHandler.php index 08972ab11990b0a8c6d542d11e890eb44f9afe7c..ee62c2277e42f3ba4ee419452bcc276ef4ebf907 100644 --- a/core/modules/file/src/FileAccessController.php +++ b/core/modules/file/src/FileAccessControlHandler.php @@ -2,20 +2,20 @@ /** * @file - * Contains \Drupal\file\FileAccessController. + * Contains \Drupal\file\FileAccessControlHandler. */ namespace Drupal\file; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Session\AccountInterface; /** - * Provides a File access controller. + * Provides a File access control handler. */ -class FileAccessController extends EntityAccessController { +class FileAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/filter/src/Entity/FilterFormat.php b/core/modules/filter/src/Entity/FilterFormat.php index c8c1942043ba78cadd82b52a15c6858cd2341295..2e68bba702b7420cd409906db1524f6c7451bd63 100644 --- a/core/modules/filter/src/Entity/FilterFormat.php +++ b/core/modules/filter/src/Entity/FilterFormat.php @@ -27,7 +27,7 @@ * "disable" = "Drupal\filter\Form\FilterDisableForm" * }, * "list_builder" = "Drupal\filter\FilterFormatListBuilder", - * "access" = "Drupal\filter\FilterFormatAccess", + * "access" = "Drupal\filter\FilterFormatAccessControlHandler", * }, * config_prefix = "format", * admin_permission = "administer filters", diff --git a/core/modules/filter/src/FilterFormatAccess.php b/core/modules/filter/src/FilterFormatAccessControlHandler.php similarity index 77% rename from core/modules/filter/src/FilterFormatAccess.php rename to core/modules/filter/src/FilterFormatAccessControlHandler.php index b6f6f587bbd669751424f3f0fb772e0776608c33..1a876b997e7347ebe803d693015fd4cf4454bb2d 100644 --- a/core/modules/filter/src/FilterFormatAccess.php +++ b/core/modules/filter/src/FilterFormatAccessControlHandler.php @@ -2,19 +2,21 @@ /** * @file - * Contains \Drupal\filter\FilterFormatAccess. + * Contains \Drupal\filter\FilterFormatAccessControlHandler. */ namespace Drupal\filter; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; /** - * Defines the access controller for the filter format entity type. + * Defines the access control handler for the filter format entity type. + * + * @see \Drupal\filter\Entity\FilterFormat */ -class FilterFormatAccess extends EntityAccessController { +class FilterFormatAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 51b98a62256b5b081a1ecb7cecfcade38cb2f86c..d30c85b73ebef92bc9009110116ecf812d55120e 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -114,7 +114,7 @@ function forum_menu_local_tasks(&$data, $route_name) { // Loop through all bundles for forum taxonomy vocabulary field. $field_map = \Drupal::entityManager()->getFieldMap(); foreach ($field_map['node']['taxonomy_forums']['bundles'] as $type) { - if (\Drupal::entityManager()->getAccessController('node')->createAccess($type)) { + if (\Drupal::entityManager()->getAccessControlHandler('node')->createAccess($type)) { $links[$type] = array( '#theme' => 'menu_local_action', '#link' => array( diff --git a/core/modules/language/src/Entity/Language.php b/core/modules/language/src/Entity/Language.php index 123fb7c48552e81e1e797b4ca4dfbc7e931e6297..d80a73547196236acd0a53fa1a45e6fcf245845a 100644 --- a/core/modules/language/src/Entity/Language.php +++ b/core/modules/language/src/Entity/Language.php @@ -22,7 +22,7 @@ * label = @Translation("Language"), * controllers = { * "list_builder" = "Drupal\language\LanguageListBuilder", - * "access" = "Drupal\language\LanguageAccessController", + * "access" = "Drupal\language\LanguageAccessControlHandler", * "form" = { * "add" = "Drupal\language\Form\LanguageAddForm", * "edit" = "Drupal\language\Form\LanguageEditForm", diff --git a/core/modules/language/src/LanguageAccessController.php b/core/modules/language/src/LanguageAccessControlHandler.php similarity index 61% rename from core/modules/language/src/LanguageAccessController.php rename to core/modules/language/src/LanguageAccessControlHandler.php index 5ebded0938698069949ce21b76960630c3972cfe..4adb778319f5d868709e98d662698d3c25544c04 100644 --- a/core/modules/language/src/LanguageAccessController.php +++ b/core/modules/language/src/LanguageAccessControlHandler.php @@ -2,16 +2,21 @@ /** * @file - * Contains \Drupal\language\LanguageAccessController. + * Contains \Drupal\language\LanguageAccessControlHandler. */ namespace Drupal\language; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; -class LanguageAccessController extends EntityAccessController { +/** + * Defines the access control handler for the language entity type. + * + * @see \Drupal\language\Entity\Language + */ +class LanguageAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php index d89005b705b0a841eeb99c11710eb11150e5486b..ae57007f0ed3a7698d84f9c9e1be28c5e64d5d02 100644 --- a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -22,7 +22,7 @@ * label = @Translation("Custom menu link"), * controllers = { * "storage" = "Drupal\Core\Entity\ContentEntityDatabaseStorage", - * "access" = "Drupal\menu_link_content\MenuLinkContentAccessController", + * "access" = "Drupal\menu_link_content\MenuLinkContentAccessControlHandler", * "form" = { * "default" = "Drupal\menu_link_content\Form\MenuLinkContentForm", * "delete" = "Drupal\menu_link_content\Form\MenuLinkContentDeleteForm" diff --git a/core/modules/menu_link_content/src/MenuLinkContentAccessController.php b/core/modules/menu_link_content/src/MenuLinkContentAccessControlHandler.php similarity index 86% rename from core/modules/menu_link_content/src/MenuLinkContentAccessController.php rename to core/modules/menu_link_content/src/MenuLinkContentAccessControlHandler.php index ad36c1998b617734100b5a72a993a055c4478a89..e2d43c75610d6781ac6f8c749ebaa20d02d4c135 100644 --- a/core/modules/menu_link_content/src/MenuLinkContentAccessController.php +++ b/core/modules/menu_link_content/src/MenuLinkContentAccessControlHandler.php @@ -1,23 +1,23 @@ getAccessController('node')->countGrants(); + $grant_count = \Drupal::entityManager()->getAccessControlHandler('node')->countGrants(); if ($grant_count != 1 || count(\Drupal::moduleHandler()->getImplementations('node_grants')) > 0) { $value = format_plural($grant_count, 'One permission in use', '@count permissions in use', array('@count' => $grant_count)); } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index fdec8ba9fc63cba3dae3bcefad1c377d9967aba5..ff8812505ec4ff2275d4e376a9260da4b2f32572 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -1111,7 +1111,7 @@ function node_form_system_themes_admin_form_submit($form, FormStateInterface $fo * @{ * The node access system determines who can do what to which nodes. * - * In determining access rights for a node, \Drupal\node\NodeAccessController + * In determining access rights for a node, \Drupal\node\NodeAccessControlHandler * first checks whether the user has the "bypass node access" permission. Such * users have unrestricted access to all nodes. user 1 will always pass this * check. @@ -1315,7 +1315,7 @@ function node_access_view_all_nodes($account = NULL) { $access[$account->id()] = TRUE; } else { - $access[$account->id()] = \Drupal::entityManager()->getAccessController('node')->checkAllGrants($account); + $access[$account->id()] = \Drupal::entityManager()->getAccessControlHandler('node')->checkAllGrants($account); } return $access[$account->id()]; @@ -1439,8 +1439,8 @@ function node_access_needs_rebuild($rebuild = NULL) { * @see node_access_needs_rebuild() */ function node_access_rebuild($batch_mode = FALSE) { - $access_controller = \Drupal::entityManager()->getAccessController('node'); - $access_controller->deleteGrants(); + $access_control_handler = \Drupal::entityManager()->getAccessControlHandler('node'); + $access_control_handler->deleteGrants(); // Only recalculate if the site is using a node_access module. if (count(\Drupal::moduleHandler()->getImplementations('node_grants'))) { if ($batch_mode) { @@ -1467,14 +1467,14 @@ function node_access_rebuild($batch_mode = FALSE) { // To preserve database integrity, only write grants if the node // loads successfully. if (!empty($node)) { - $access_controller->writeGrants($node); + $access_control_handler->writeGrants($node); } } } } else { // Not using any node_access modules. Add the default grant. - $access_controller->writeDefaultGrant(); + $access_control_handler->writeDefaultGrant(); } if (!isset($batch)) { @@ -1513,7 +1513,7 @@ function _node_access_rebuild_batch_operation(&$context) { // To preserve database integrity, only write grants if the node // loads successfully. if (!empty($node)) { - \Drupal::entityManager()->getAccessController('node')->writeGrants($node); + \Drupal::entityManager()->getAccessControlHandler('node')->writeGrants($node); } $context['sandbox']['progress']++; $context['sandbox']['current_node'] = $nid; diff --git a/core/modules/node/src/Access/NodeAddAccessCheck.php b/core/modules/node/src/Access/NodeAddAccessCheck.php index c7bb0e778ebf37ffee8a58f4dc117966c04f8358..3813f9f0144c2dab63e2caaf815e13115dabdbd6 100644 --- a/core/modules/node/src/Access/NodeAddAccessCheck.php +++ b/core/modules/node/src/Access/NodeAddAccessCheck.php @@ -47,14 +47,14 @@ public function __construct(EntityManagerInterface $entity_manager) { * A \Drupal\Core\Access\AccessInterface constant value. */ public function access(AccountInterface $account, NodeTypeInterface $node_type = NULL) { - $access_controller = $this->entityManager->getAccessController('node'); + $access_control_handler = $this->entityManager->getAccessControlHandler('node'); // If checking whether a node of a particular type may be created. if ($node_type) { - return $access_controller->createAccess($node_type->id(), $account) ? static::ALLOW : static::DENY; + return $access_control_handler->createAccess($node_type->id(), $account) ? static::ALLOW : static::DENY; } // If checking whether a node of any type may be created. foreach (node_permissions_get_configured_types() as $node_type) { - if ($access_controller->createAccess($node_type->id(), $account)) { + if ($access_control_handler->createAccess($node_type->id(), $account)) { return static::ALLOW; } } diff --git a/core/modules/node/src/Access/NodeRevisionAccessCheck.php b/core/modules/node/src/Access/NodeRevisionAccessCheck.php index 66dc7e208816aef2c703491fcd7216fd11f19a19..3801e367eec720ef3c5d3617dc2bb9bf284ef348 100644 --- a/core/modules/node/src/Access/NodeRevisionAccessCheck.php +++ b/core/modules/node/src/Access/NodeRevisionAccessCheck.php @@ -27,9 +27,9 @@ class NodeRevisionAccessCheck implements AccessInterface { protected $nodeStorage; /** - * The node access controller. + * The node access control handler. * - * @var \Drupal\Core\Entity\EntityAccessControllerInterface + * @var \Drupal\Core\Entity\EntityAccessControlHandlerInterface */ protected $nodeAccess; @@ -57,7 +57,7 @@ class NodeRevisionAccessCheck implements AccessInterface { */ public function __construct(EntityManagerInterface $entity_manager, Connection $connection) { $this->nodeStorage = $entity_manager->getStorage('node'); - $this->nodeAccess = $entity_manager->getAccessController('node'); + $this->nodeAccess = $entity_manager->getAccessControlHandler('node'); $this->connection = $connection; } diff --git a/core/modules/node/src/Controller/NodeController.php b/core/modules/node/src/Controller/NodeController.php index d98ec00858af79452af01a7bfa297c5e7319475c..e40cf7ea80b5ac306b09428c51363adb7268b515 100644 --- a/core/modules/node/src/Controller/NodeController.php +++ b/core/modules/node/src/Controller/NodeController.php @@ -64,7 +64,7 @@ public function addPage() { // Only use node types the user has access to. foreach ($this->entityManager()->getStorage('node_type')->loadMultiple() as $type) { - if ($this->entityManager()->getAccessController('node')->createAccess($type->type)) { + if ($this->entityManager()->getAccessControlHandler('node')->createAccess($type->type)) { $content[$type->type] = $type; } } diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php index 19f311ecd57368f35e9570752e337eaa54870fff..b9d5a53094eab1c7f4a6f250032812effcb70dce 100644 --- a/core/modules/node/src/Entity/Node.php +++ b/core/modules/node/src/Entity/Node.php @@ -26,7 +26,7 @@ * controllers = { * "storage" = "Drupal\node\NodeStorage", * "view_builder" = "Drupal\node\NodeViewBuilder", - * "access" = "Drupal\node\NodeAccessController", + * "access" = "Drupal\node\NodeAccessControlHandler", * "form" = { * "default" = "Drupal\node\NodeForm", * "delete" = "Drupal\node\Form\NodeDeleteForm", @@ -103,7 +103,7 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) { // default revision. There's no need to delete existing records if the node // is new. if ($this->isDefaultRevision()) { - \Drupal::entityManager()->getAccessController('node')->writeGrants($this, $update); + \Drupal::entityManager()->getAccessControlHandler('node')->writeGrants($this, $update); } // Reindex the node when it is updated. The node is automatically indexed @@ -151,7 +151,7 @@ public function access($operation = 'view', AccountInterface $account = NULL) { } return \Drupal::entityManager() - ->getAccessController($this->entityTypeId) + ->getAccessControlHandler($this->entityTypeId) ->access($this, $operation, $this->prepareLangcode(), $account); } diff --git a/core/modules/node/src/Entity/NodeType.php b/core/modules/node/src/Entity/NodeType.php index ecc21ea03f931e2c48385b3c7d2d0d0133cb5fcc..91ce4f7afa05fa820afa1c22dd6a3a6cec9e5457 100644 --- a/core/modules/node/src/Entity/NodeType.php +++ b/core/modules/node/src/Entity/NodeType.php @@ -19,7 +19,7 @@ * id = "node_type", * label = @Translation("Content type"), * controllers = { - * "access" = "Drupal\node\NodeTypeAccessController", + * "access" = "Drupal\node\NodeTypeAccessControlHandler", * "form" = { * "add" = "Drupal\node\NodeTypeForm", * "edit" = "Drupal\node\NodeTypeForm", diff --git a/core/modules/node/src/NodeAccessController.php b/core/modules/node/src/NodeAccessControlHandler.php similarity index 90% rename from core/modules/node/src/NodeAccessController.php rename to core/modules/node/src/NodeAccessControlHandler.php index ab38a266c171214adab75243d1f18f3929f4c01f..e6a8ce7f6ecc6a8b05491b45801c69e1b2a8f655 100644 --- a/core/modules/node/src/NodeAccessController.php +++ b/core/modules/node/src/NodeAccessControlHandler.php @@ -2,27 +2,25 @@ /** * @file - * Contains \Drupal\node\NodeAccessController. + * Contains \Drupal\node\NodeAccessControlHandler. */ namespace Drupal\node; -use Drupal\Core\Database\Connection; -use Drupal\Core\Database\Query\SelectInterface; use Drupal\Core\Entity\EntityControllerInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Language\LanguageInterface; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Session\AccountInterface; -use Drupal\user\Entity\User; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Defines the access controller for the node entity type. + * Defines the access control handler for the node entity type. + * + * @see \Drupal\node\Entity\Node */ -class NodeAccessController extends EntityAccessController implements NodeAccessControllerInterface, EntityControllerInterface { +class NodeAccessControlHandler extends EntityAccessControlHandler implements NodeAccessControlHandlerInterface, EntityControllerInterface { /** * The node grant storage. @@ -32,7 +30,7 @@ class NodeAccessController extends EntityAccessController implements NodeAccessC protected $grantStorage; /** - * Constructs a NodeAccessController object. + * Constructs a NodeAccessControlHandler object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/node/src/NodeAccessControllerInterface.php b/core/modules/node/src/NodeAccessControlHandlerInterface.php similarity index 93% rename from core/modules/node/src/NodeAccessControllerInterface.php rename to core/modules/node/src/NodeAccessControlHandlerInterface.php index 368f7bf1399d127883bbee582a6b96c788a9119d..cb395d00a0021be69a83cfaf495be5cc4db8535a 100644 --- a/core/modules/node/src/NodeAccessControllerInterface.php +++ b/core/modules/node/src/NodeAccessControlHandlerInterface.php @@ -1,14 +1,17 @@ assertNodeAccess($expected_node_access_no_access, $node_public_no_language, $web_user, 'hr'); // Reset the node access cache and turn on our test node access code. - \Drupal::entityManager()->getAccessController('node')->resetCache(); + \Drupal::entityManager()->getAccessControlHandler('node')->resetCache(); \Drupal::state()->set('node_access_test_secret_catalan', 1); $node_public_ca = $this->drupalCreateNode(array('body' => array(array()), 'langcode' => 'ca', 'private' => FALSE)); $this->assertTrue($node_public_ca->language()->id == 'ca', 'Node created as Catalan.'); @@ -122,7 +122,7 @@ function testNodeAccess() { // static cache has not been reset. $this->assertNodeAccess($expected_node_access_no_access, $node_public_ca, $web_user, 'ca'); - \Drupal::entityManager()->getAccessController('node')->resetCache(); + \Drupal::entityManager()->getAccessControlHandler('node')->resetCache(); // Tests that access is granted if requested with no language. $this->assertNodeAccess($expected_node_access, $node_public_no_language, $web_user); @@ -185,7 +185,7 @@ function testNodeAccessPrivate() { $this->assertNodeAccess($expected_node_access_no_access, $node_private_no_language, $web_user, 'hr'); // Reset the node access cache and turn on our test node access code. - \Drupal::entityManager()->getAccessController('node')->resetCache(); + \Drupal::entityManager()->getAccessControlHandler('node')->resetCache(); \Drupal::state()->set('node_access_test_secret_catalan', 1); // Tests that access is not granted if requested with no language. @@ -207,7 +207,7 @@ function testNodeAccessPrivate() { $this->assertNodeAccess($expected_node_access_no_access, $node_private_ca, $web_user, 'ca'); $this->assertNodeAccess($expected_node_access_no_access, $node_private_ca, $private_ca_user, 'ca'); - \Drupal::entityManager()->getAccessController('node')->resetCache(); + \Drupal::entityManager()->getAccessControlHandler('node')->resetCache(); \Drupal::state()->set('node_access_test_secret_catalan', 0); // Tests that Catalan is still not accessible for a user with no access to diff --git a/core/modules/node/src/Tests/NodeTestBase.php b/core/modules/node/src/Tests/NodeTestBase.php index dcb0518e8f716cb458f590488c36ddb50a299d1d..2e55bf308248889295420d1baa3749bccc89ed22 100644 --- a/core/modules/node/src/Tests/NodeTestBase.php +++ b/core/modules/node/src/Tests/NodeTestBase.php @@ -23,11 +23,11 @@ abstract class NodeTestBase extends WebTestBase { public static $modules = array('node', 'datetime'); /** - * The node access controller. + * The node access control handler. * - * @var \Drupal\Core\Entity\EntityAccessControllerInterface + * @var \Drupal\Core\Entity\EntityAccessControlHandlerInterface */ - protected $accessController; + protected $accessHandler; function setUp() { parent::setUp(); @@ -43,7 +43,7 @@ function setUp() { ))); $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); } - $this->accessController = \Drupal::entityManager()->getAccessController('node'); + $this->accessHandler = \Drupal::entityManager()->getAccessControlHandler('node'); } /** @@ -67,7 +67,7 @@ function assertNodeAccess(array $ops, $node, AccountInterface $account, $langcod if (empty($langcode)) { $langcode = $node->prepareLangcode(); } - $this->assertEqual($result, $this->accessController->access($node, $op, $langcode, $account), $this->nodeAccessAssertMessage($op, $result, $langcode)); + $this->assertEqual($result, $this->accessHandler->access($node, $op, $langcode, $account), $this->nodeAccessAssertMessage($op, $result, $langcode)); } } @@ -85,7 +85,7 @@ function assertNodeAccess(array $ops, $node, AccountInterface $account, $langcod * to check. If NULL, the untranslated (fallback) access is checked. */ function assertNodeCreateAccess($bundle, $result, AccountInterface $account, $langcode = NULL) { - $this->assertEqual($result, $this->accessController->createAccess($bundle, $account, array( + $this->assertEqual($result, $this->accessHandler->createAccess($bundle, $account, array( 'langcode' => $langcode, )), $this->nodeAccessAssertMessage('create', $result, $langcode)); } diff --git a/core/modules/search/src/Entity/SearchPage.php b/core/modules/search/src/Entity/SearchPage.php index b46c737bb9f89fe451609e010cb8e1e4b3e3400a..4d15e556d4a2b9804e06360e46e29e3014fb79e4 100644 --- a/core/modules/search/src/Entity/SearchPage.php +++ b/core/modules/search/src/Entity/SearchPage.php @@ -23,7 +23,7 @@ * id = "search_page", * label = @Translation("Search page"), * controllers = { - * "access" = "Drupal\search\SearchPageAccessController", + * "access" = "Drupal\search\SearchPageAccessControlHandler", * "storage" = "Drupal\Core\Config\Entity\ConfigEntityStorage", * "list_builder" = "Drupal\search\SearchPageListBuilder", * "form" = { diff --git a/core/modules/search/src/SearchPageAccessController.php b/core/modules/search/src/SearchPageAccessControlHandler.php similarity index 74% rename from core/modules/search/src/SearchPageAccessController.php rename to core/modules/search/src/SearchPageAccessControlHandler.php index cd5127828a7bf4bc6b95921630b089c4e6d4e242..65723b695deceef15a1549f2975c46594ca3ce72 100644 --- a/core/modules/search/src/SearchPageAccessController.php +++ b/core/modules/search/src/SearchPageAccessControlHandler.php @@ -2,20 +2,22 @@ /** * @file - * Contains \Drupal\search\SearchPageAccessController. + * Contains \Drupal\search\SearchPageAccessControlHandler. */ namespace Drupal\search; use Drupal\Core\Access\AccessibleInterface; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; /** - * Defines the access controller for the search page entity type. + * Defines the access control handler for the search page entity type. + * + * @see \Drupal\search\Entity\SearchPage */ -class SearchPageAccessController extends EntityAccessController { +class SearchPageAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/shortcut/src/Entity/Shortcut.php b/core/modules/shortcut/src/Entity/Shortcut.php index 4fd0ce668eed92aad8f764f7430aac58d330bcc7..bec4cb6bc8cef48d76131f7f2910e7b371358794 100644 --- a/core/modules/shortcut/src/Entity/Shortcut.php +++ b/core/modules/shortcut/src/Entity/Shortcut.php @@ -22,7 +22,7 @@ * id = "shortcut", * label = @Translation("Shortcut link"), * controllers = { - * "access" = "Drupal\shortcut\ShortcutAccessController", + * "access" = "Drupal\shortcut\ShortcutAccessControlHandler", * "form" = { * "default" = "Drupal\shortcut\ShortcutForm", * "add" = "Drupal\shortcut\ShortcutForm", diff --git a/core/modules/shortcut/src/Entity/ShortcutSet.php b/core/modules/shortcut/src/Entity/ShortcutSet.php index 473809beeda024c122e17478b20ba0973146c073..5957961dc40d80b83b6422968599e2ae7b4cc41f 100644 --- a/core/modules/shortcut/src/Entity/ShortcutSet.php +++ b/core/modules/shortcut/src/Entity/ShortcutSet.php @@ -19,7 +19,7 @@ * label = @Translation("Shortcut set"), * controllers = { * "storage" = "Drupal\shortcut\ShortcutSetStorage", - * "access" = "Drupal\shortcut\ShortcutSetAccessController", + * "access" = "Drupal\shortcut\ShortcutSetAccessControlHandler", * "list_builder" = "Drupal\shortcut\ShortcutSetListBuilder", * "form" = { * "default" = "Drupal\shortcut\ShortcutSetForm", diff --git a/core/modules/shortcut/src/ShortcutAccessController.php b/core/modules/shortcut/src/ShortcutAccessControlHandler.php similarity index 81% rename from core/modules/shortcut/src/ShortcutAccessController.php rename to core/modules/shortcut/src/ShortcutAccessControlHandler.php index b76d48b1194895dc0886cc57d8305bbbc66ca99c..c08f0964cf1ced59362ed62a267159b0abd1a0ed 100644 --- a/core/modules/shortcut/src/ShortcutAccessController.php +++ b/core/modules/shortcut/src/ShortcutAccessControlHandler.php @@ -2,12 +2,12 @@ /** * @file - * Contains \Drupal\shortcut\ShortcutAccessController. + * Contains \Drupal\shortcut\ShortcutAccessControlHandler. */ namespace Drupal\shortcut; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityControllerInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeInterface; @@ -15,9 +15,11 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Defines the access controller for the test entity type. + * Defines the access control handler for the shortcut entity type. + * + * @see \Drupal\shortcut\Entity\Shortcut */ -class ShortcutAccessController extends EntityAccessController implements EntityControllerInterface { +class ShortcutAccessControlHandler extends EntityAccessControlHandler implements EntityControllerInterface { /** * The shortcut_set storage. @@ -27,7 +29,7 @@ class ShortcutAccessController extends EntityAccessController implements EntityC protected $shortcutSetStorage; /** - * Constructs a ShortcutAccessController object. + * Constructs a ShortcutAccessControlHandler object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/shortcut/src/ShortcutSetAccessController.php b/core/modules/shortcut/src/ShortcutSetAccessControlHandler.php similarity index 80% rename from core/modules/shortcut/src/ShortcutSetAccessController.php rename to core/modules/shortcut/src/ShortcutSetAccessControlHandler.php index cb49a4a17584d72277ca5c0556ce78748702254b..b6ca7c6344a6af4b3272fbb726af231cd0e6ea0b 100644 --- a/core/modules/shortcut/src/ShortcutSetAccessController.php +++ b/core/modules/shortcut/src/ShortcutSetAccessControlHandler.php @@ -2,19 +2,21 @@ /** * @file - * Contains \Drupal\shortcut\ShortcutSetAccessController. + * Contains \Drupal\shortcut\ShortcutSetAccessControlHandler. */ namespace Drupal\shortcut; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Session\AccountInterface; /** - * Defines the access controller for the shortcut entity type. + * Defines the access control handler for the shortcut set entity type. + * + * @see \Drupal\shortcut\Entity\ShortcutSet */ -class ShortcutSetAccessController extends EntityAccessController { +class ShortcutSetAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/system/core.api.php b/core/modules/system/core.api.php index 887a386cd83717430a965ade7b937f7ec79c2441..d86936025ff1d79e577c922cc93eb1a2a908f0eb 100644 --- a/core/modules/system/core.api.php +++ b/core/modules/system/core.api.php @@ -565,8 +565,9 @@ * to check access. See the @link menu Routing topic @endlink for more * information. * - Entities: Access for various entity operations is designated either with - * simple permissions or access controller classes in the entity annotation. - * See the @link entity_api Entity API topic @endlink for more information. + * simple permissions or access control handler classes in the entity + * annotation. See the @link entity_api Entity API topic @endlink for more + * information. * - Other code: There is a 'current_user' service, which can be injected into * classes to provide access to the current user account (see the * @link container Services and Dependency Injection topic @endlink for more diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php index b4f7492cbe0aa4447c02a3f8053d05030866b695..e80f34e41febb9847feac1e90958847dc68923cf 100644 --- a/core/modules/system/entity.api.php +++ b/core/modules/system/entity.api.php @@ -299,10 +299,10 @@ * the content. Configuration translation is handled automatically by the * Configuration Translation module, without the need of a controller class. * - access: If your configuration entity has complex permissions, you might - * need an access controller, implementing - * \Drupal\Core\Entity\EntityAccessControllerInterface, but most entities + * need an access control handling, implementing + * \Drupal\Core\Entity\EntityAccessControlHandlerInterface, but most entities * can just use the 'admin_permission' annotation instead. Note that if you - * are creating your own access controller, you should override the + * are creating your own access control handler, you should override the * checkAccess() and checkCreateAccess() methods, not access(). * - storage: A class implementing * \Drupal\Core\Entity\EntityStorageInterface. If not specified, content @@ -478,7 +478,7 @@ * The interface related to access checking in entities and fields is * \Drupal\Core\Access\AccessibleInterface. * - * The default entity access controller invokes two hooks while checking + * The default entity access control handler invokes two hooks while checking * access on a single entity: hook_entity_access() is invoked first, and * then hook_ENTITY_TYPE_access() (where ENTITY_TYPE is the machine name * of the entity type). If no module returns a TRUE or FALSE value from @@ -517,7 +517,7 @@ * A boolean to explicitly allow or deny access, or NULL to neither allow nor * deny access. * - * @see \Drupal\Core\Entity\EntityAccessController + * @see \Drupal\Core\Entity\EntityAccessControlHandler * @see hook_entity_create_access() * @see hook_ENTITY_TYPE_access() * @@ -543,7 +543,7 @@ function hook_entity_access(\Drupal\Core\Entity\EntityInterface $entity, $operat * A boolean to explicitly allow or deny access, or NULL to neither allow nor * deny access. * - * @see \Drupal\Core\Entity\EntityAccessController + * @see \Drupal\Core\Entity\EntityAccessControlHandler * @see hook_ENTITY_TYPE_create_access() * @see hook_entity_access() * @@ -565,7 +565,7 @@ function hook_ENTITY_TYPE_access(\Drupal\Core\Entity\EntityInterface $entity, $o * A boolean to explicitly allow or deny access, or NULL to neither allow nor * deny access. * - * @see \Drupal\Core\Entity\EntityAccessController + * @see \Drupal\Core\Entity\EntityAccessControlHandler * @see hook_entity_access() * @see hook_ENTITY_TYPE_create_access() * @@ -587,7 +587,7 @@ function hook_entity_create_access(\Drupal\Core\Session\AccountInterface $accoun * A boolean to explicitly allow or deny access, or NULL to neither allow nor * deny access. * - * @see \Drupal\Core\Entity\EntityAccessController + * @see \Drupal\Core\Entity\EntityAccessControlHandler * @see hook_ENTITY_TYPE_access() * @see hook_entity_create_access() * @@ -1799,7 +1799,7 @@ function hook_entity_operation_alter(array &$operations, \Drupal\Core\Entity\Ent * Control access to fields. * * This hook is invoked from - * \Drupal\Core\Entity\EntityAccessController::fieldAccess() to let modules + * \Drupal\Core\Entity\EntityAccessControlHandler::fieldAccess() to let modules * grant or deny operations on fields. * * @param string $operation diff --git a/core/modules/system/src/DateFormatAccessController.php b/core/modules/system/src/DateFormatAccessControlHandler.php similarity index 68% rename from core/modules/system/src/DateFormatAccessController.php rename to core/modules/system/src/DateFormatAccessControlHandler.php index a5483b627df8fbabc01b0a34b59a700597b3a86b..943b678dcb0951f08bc4f7695e55bbbdbfda150c 100644 --- a/core/modules/system/src/DateFormatAccessController.php +++ b/core/modules/system/src/DateFormatAccessControlHandler.php @@ -2,19 +2,21 @@ /** * @file - * Contains \Drupal\system\DateFormatAccessController. + * Contains \Drupal\system\DateFormatAccessControlHandler. */ namespace Drupal\system; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; /** - * Provides an access controller for date formats. + * Defines the access control handler for the date format entity type. + * + * @see \Drupal\system\Entity\DateFormat */ -class DateFormatAccessController extends EntityAccessController { +class DateFormatAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/system/src/Entity/DateFormat.php b/core/modules/system/src/Entity/DateFormat.php index 2a0cce681a4983ae0c7719d7fee363afbb935dc2..774eb3c109ef57e43ae5cf6e63ed99a813eec33b 100644 --- a/core/modules/system/src/Entity/DateFormat.php +++ b/core/modules/system/src/Entity/DateFormat.php @@ -19,7 +19,7 @@ * id = "date_format", * label = @Translation("Date format"), * controllers = { - * "access" = "Drupal\system\DateFormatAccessController", + * "access" = "Drupal\system\DateFormatAccessControlHandler", * "list_builder" = "Drupal\system\DateFormatListBuilder", * "form" = { * "add" = "Drupal\system\Form\DateFormatAddForm", diff --git a/core/modules/system/src/Entity/Menu.php b/core/modules/system/src/Entity/Menu.php index 756728fb84c53640d991af4d324709eaa961c325..a1848bb16191114386970a2771cdb1aadbcd0b3f 100644 --- a/core/modules/system/src/Entity/Menu.php +++ b/core/modules/system/src/Entity/Menu.php @@ -18,7 +18,7 @@ * id = "menu", * label = @Translation("Menu"), * controllers = { - * "access" = "Drupal\system\MenuAccessController" + * "access" = "Drupal\system\MenuAccessControlHandler" * }, * admin_permission = "administer menu", * entity_keys = { diff --git a/core/modules/system/src/MenuAccessController.php b/core/modules/system/src/MenuAccessControlHandler.php similarity index 66% rename from core/modules/system/src/MenuAccessController.php rename to core/modules/system/src/MenuAccessControlHandler.php index fe8436878c384f38c1342aa300df7b83673386ac..acee9aad3bd3fa657470104d0d67ce43c444f70a 100644 --- a/core/modules/system/src/MenuAccessController.php +++ b/core/modules/system/src/MenuAccessControlHandler.php @@ -2,19 +2,21 @@ /** * @file - * Contains \Drupal\system\MenuAccessController. + * Contains \Drupal\system\MenuAccessControlHandler. */ namespace Drupal\system; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Session\AccountInterface; /** - * Defines the access controller for the menu entity type. + * Defines the access control handler for the menu entity type. + * + * @see \Drupal\system\Entity\Menu */ -class MenuAccessController extends EntityAccessController { +class MenuAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/system/src/Tests/Entity/EntityAccessTest.php b/core/modules/system/src/Tests/Entity/EntityAccessControlHandlerTest.php similarity index 83% rename from core/modules/system/src/Tests/Entity/EntityAccessTest.php rename to core/modules/system/src/Tests/Entity/EntityAccessControlHandlerTest.php index 70f402bfd9c0ebfde9c9c71dce1ffaec1c614d9d..8727cc6cd65718267a74577fd0c0c23981c67259 100644 --- a/core/modules/system/src/Tests/Entity/EntityAccessTest.php +++ b/core/modules/system/src/Tests/Entity/EntityAccessControlHandlerTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\system\Tests\Entity\EntityAccessTest. + * Contains \Drupal\system\Tests\Entity\EntityAccessHControlandlerTest. */ namespace Drupal\system\Tests\Entity; @@ -10,14 +10,14 @@ use Drupal\Core\Language\Language; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Access\AccessibleInterface; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; /** - * Tests entity access. + * Tests the entity access control handler. * * @group Entity */ -class EntityAccessTest extends EntityLanguageTestBase { +class EntityAccessControlHandlerTest extends EntityLanguageTestBase { function setUp() { parent::setUp(); @@ -67,16 +67,16 @@ function testEntityAccess() { } /** - * Ensures that the default controller is used as a fallback. + * Ensures that the default handler is used as a fallback. */ function testEntityAccessDefaultController() { // The implementation requires that the global user id can be loaded. \Drupal::currentUser()->setAccount($this->createUser(array('uid' => 2))); - // Check that the default access controller is used for entities that don't - // have a specific access controller defined. - $controller = $this->container->get('entity.manager')->getAccessController('entity_test_default_access'); - $this->assertTrue($controller instanceof EntityAccessController, 'The default entity controller is used for the entity_test_default_access entity type.'); + // Check that the default access control handler is used for entities that don't + // have a specific access control handler defined. + $handler = $this->container->get('entity.manager')->getAccessControlHandler('entity_test_default_access'); + $this->assertTrue($handler instanceof EntityAccessControlHandler, 'The default entity handler is used for the entity_test_default_access entity type.'); $entity = entity_create('entity_test_default_access'); $this->assertEntityAccess(array( diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php index 7b7efaf666701669a06f8f148dc10012c3be7109..4e94184305cd551c54e7802ac4c6635be4f355d8 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php @@ -23,7 +23,7 @@ * controllers = { * "list_builder" = "Drupal\entity_test\EntityTestListBuilder", * "view_builder" = "Drupal\entity_test\EntityTestViewBuilder", - * "access" = "Drupal\entity_test\EntityTestAccessController", + * "access" = "Drupal\entity_test\EntityTestAccessControlHandler", * "form" = { * "default" = "Drupal\entity_test\EntityTestForm", * "delete" = "Drupal\entity_test\EntityTestDeleteForm" diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestBaseFieldDisplay.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestBaseFieldDisplay.php index 0c0c753b887476c063361c6a1dbbb6815cd20e27..e9e71234d962eac62d4fdc98c450f71dadd7ae44 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestBaseFieldDisplay.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestBaseFieldDisplay.php @@ -17,7 +17,7 @@ * id = "entity_test_base_field_display", * label = @Translation("Test entity - base field display"), * controllers = { - * "access" = "Drupal\entity_test\EntityTestAccessController", + * "access" = "Drupal\entity_test\EntityTestAccessControlHandler", * "form" = { * "default" = "Drupal\entity_test\EntityTestForm" * }, diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCache.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCache.php index ab5fdab9c194ae6234621dd2a5fd6c1bc5a332d4..a6e02e1d9e6ffda6802ef02f9e1be5ed3031828e 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCache.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCache.php @@ -14,7 +14,7 @@ * id = "entity_test_cache", * label = @Translation("Test entity with field cache"), * controllers = { - * "access" = "Drupal\entity_test\EntityTestAccessController", + * "access" = "Drupal\entity_test\EntityTestAccessControlHandler", * "form" = { * "default" = "Drupal\entity_test\EntityTestForm" * }, diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestDefaultAccess.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestDefaultAccess.php index 7df4362a44070fa4f7d3c4f337645a9b8f2772e1..239250fa2ddb11bc4998e8abf435a1cd925c53fe 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestDefaultAccess.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestDefaultAccess.php @@ -8,7 +8,7 @@ namespace Drupal\entity_test\Entity; /** - * Defines a test entity class with no access controller. + * Defines a test entity class with no access control handler. * * @ContentEntityType( * id = "entity_test_default_access", diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMul.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMul.php index a8abda55d9600bda5aa8b2d3c5d9f7d5bbfd1d8d..c5227e49b49afc2524db7f55f45eae164b52f191 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMul.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMul.php @@ -19,7 +19,7 @@ * label = @Translation("Test entity - data table"), * controllers = { * "view_builder" = "Drupal\entity_test\EntityTestViewBuilder", - * "access" = "Drupal\entity_test\EntityTestAccessController", + * "access" = "Drupal\entity_test\EntityTestAccessControlHandler", * "form" = { * "default" = "Drupal\entity_test\EntityTestForm", * "delete" = "Drupal\entity_test\EntityTestDeleteForm" diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRev.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRev.php index b30cbb11ed89b412cecdd5504e4d0b946e6d7ed1..477b651d40ee6e94f6b7e0bc2bd90928cdd4eba4 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRev.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRev.php @@ -18,7 +18,7 @@ * id = "entity_test_mulrev", * label = @Translation("Test entity - revisions and data table"), * controllers = { - * "access" = "Drupal\entity_test\EntityTestAccessController", + * "access" = "Drupal\entity_test\EntityTestAccessControlHandler", * "form" = { * "default" = "Drupal\entity_test\EntityTestForm", * "delete" = "Drupal\entity_test\EntityTestDeleteForm" diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php index ea99ed0d160104b8605c98524c752bf1d4c6174d..942424124fff2eac98d9eeaa4841c3232d5963be 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php @@ -18,7 +18,7 @@ * id = "entity_test_rev", * label = @Translation("Test entity - revisions"), * controllers = { - * "access" = "Drupal\entity_test\EntityTestAccessController", + * "access" = "Drupal\entity_test\EntityTestAccessControlHandler", * "form" = { * "default" = "Drupal\entity_test\EntityTestForm", * "delete" = "Drupal\entity_test\EntityTestDeleteForm" diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestStringId.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestStringId.php index 627d3a53ae75ee0e1855f5b2226108a6dfd5052a..dbe4a20230991957172a1859088c8266e1a38d01 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestStringId.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestStringId.php @@ -16,7 +16,7 @@ * id = "entity_test_string_id", * label = @Translation("Test entity with string_id"), * controllers = { - * "access" = "Drupal\entity_test\EntityTestAccessController", + * "access" = "Drupal\entity_test\EntityTestAccessControlHandler", * "form" = { * "default" = "Drupal\entity_test\EntityTestForm" * }, diff --git a/core/modules/system/tests/modules/entity_test/src/EntityTestAccessController.php b/core/modules/system/tests/modules/entity_test/src/EntityTestAccessControlHandler.php similarity index 60% rename from core/modules/system/tests/modules/entity_test/src/EntityTestAccessController.php rename to core/modules/system/tests/modules/entity_test/src/EntityTestAccessControlHandler.php index 9f5fd46d8489563ab2b6803a10619f491c2399ac..d16f6abe98096585317fc62b5465eed3f70d1ce3 100644 --- a/core/modules/system/tests/modules/entity_test/src/EntityTestAccessController.php +++ b/core/modules/system/tests/modules/entity_test/src/EntityTestAccessControlHandler.php @@ -2,20 +2,28 @@ /** * @file - * Contains Drupal\entity_test\EntityTestAccessController. + * Contains Drupal\entity_test\EntityTestAccessControlHandler. */ namespace Drupal\entity_test; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Session\AccountInterface; /** - * Defines the access controller for the test entity type. + * Defines the access control handler for the test entity type. + * + * @see \Drupal\entity_test\Entity\EntityTest + * @see \Drupal\entity_test\Entity\EntityTestBaseFieldDisplay + * @see \Drupal\entity_test\Entity\EntityTestCache + * @see \Drupal\entity_test\Entity\EntityTestMul + * @see \Drupal\entity_test\Entity\EntityTestMulRev + * @see \Drupal\entity_test\Entity\EntityTestRev + * @see \Drupal\entity_test\Entity\EntityTestStringId */ -class EntityTestAccessController extends EntityAccessController { +class EntityTestAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/taxonomy/src/Entity/Term.php b/core/modules/taxonomy/src/Entity/Term.php index 6557171dcc2be784a2497f3df327d155bc080492..d01759f0f45624bdb79322d0e2aafdc097f154dd 100644 --- a/core/modules/taxonomy/src/Entity/Term.php +++ b/core/modules/taxonomy/src/Entity/Term.php @@ -23,7 +23,7 @@ * controllers = { * "storage" = "Drupal\taxonomy\TermStorage", * "view_builder" = "Drupal\taxonomy\TermViewBuilder", - * "access" = "Drupal\taxonomy\TermAccessController", + * "access" = "Drupal\taxonomy\TermAccessControlHandler", * "form" = { * "default" = "Drupal\taxonomy\TermForm", * "delete" = "Drupal\taxonomy\Form\TermDeleteForm" diff --git a/core/modules/taxonomy/src/TermAccessController.php b/core/modules/taxonomy/src/TermAccessControlHandler.php similarity index 80% rename from core/modules/taxonomy/src/TermAccessController.php rename to core/modules/taxonomy/src/TermAccessControlHandler.php index ca98dbb9211d5e23b2fcfdbfbea8ee46894bb456..fe38a4cba03d0579c165630226c0f03d937317b2 100644 --- a/core/modules/taxonomy/src/TermAccessController.php +++ b/core/modules/taxonomy/src/TermAccessControlHandler.php @@ -2,21 +2,21 @@ /** * @file - * Contains \Drupal\taxonomy\TermAccessController. + * Contains \Drupal\taxonomy\TermAccessControlHandler. */ namespace Drupal\taxonomy; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; /** - * Defines an access controller for the taxonomy term entity. + * Defines the access control handler for the taxonomy term entity type. * * @see \Drupal\taxonomy\Entity\Term */ -class TermAccessController extends EntityAccessController { +class TermAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/user/src/Entity/Role.php b/core/modules/user/src/Entity/Role.php index 20cb00424e70c171e1fc5a47239ac5a2b71ac216..e5a6f8bccc0e1ff69ce9ef961743449190267361 100644 --- a/core/modules/user/src/Entity/Role.php +++ b/core/modules/user/src/Entity/Role.php @@ -19,7 +19,7 @@ * label = @Translation("Role"), * controllers = { * "storage" = "Drupal\user\RoleStorage", - * "access" = "Drupal\user\RoleAccessController", + * "access" = "Drupal\user\RoleAccessControlHandler", * "list_builder" = "Drupal\user\RoleListBuilder", * "form" = { * "default" = "Drupal\user\RoleForm", diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php index eeb8d55e4ccbcadce907546604574fcd04464a66..cd2fb481e9f1f2380f15341412beb3645ae902dd 100644 --- a/core/modules/user/src/Entity/User.php +++ b/core/modules/user/src/Entity/User.php @@ -25,7 +25,7 @@ * label = @Translation("User"), * controllers = { * "storage" = "Drupal\user\UserStorage", - * "access" = "Drupal\user\UserAccessController", + * "access" = "Drupal\user\UserAccessControlHandler", * "list_builder" = "Drupal\user\UserListBuilder", * "view_builder" = "Drupal\Core\Entity\EntityViewBuilder", * "form" = { diff --git a/core/modules/user/src/RoleAccessController.php b/core/modules/user/src/RoleAccessControlHandler.php similarity index 67% rename from core/modules/user/src/RoleAccessController.php rename to core/modules/user/src/RoleAccessControlHandler.php index 0ab9ad8d79508a47bb21b52c6bef82cfccf6a91a..c53c2a368ed0d740d3186eb3fe4791eb3eb18314 100644 --- a/core/modules/user/src/RoleAccessController.php +++ b/core/modules/user/src/RoleAccessControlHandler.php @@ -2,19 +2,21 @@ /** * @file - * Contains \Drupal\user\RoleAccessController. + * Contains \Drupal\user\RoleAccessControlHandler. */ namespace Drupal\user; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; /** - * Defines the access controller for the user_role entity type. + * Defines the access control handler for the user role entity type. + * + * @see \Drupal\user\Entity\Role */ -class RoleAccessController extends EntityAccessController { +class RoleAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/modules/user/src/UserAccessController.php b/core/modules/user/src/UserAccessControlHandler.php similarity index 83% rename from core/modules/user/src/UserAccessController.php rename to core/modules/user/src/UserAccessControlHandler.php index 9aed19e946e22d2ac4e1a5072c627fd563a17219..81b072fa909a7e6f4e97357f8bf0b214c6707c74 100644 --- a/core/modules/user/src/UserAccessController.php +++ b/core/modules/user/src/UserAccessControlHandler.php @@ -2,19 +2,21 @@ /** * @file - * Contains \Drupal\user\UserAccessController. + * Contains \Drupal\user\UserAccessControlHandler. */ namespace Drupal\user; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Session\AccountInterface; /** - * Defines the access controller for the user entity type. + * Defines the access control handler for the user entity type. + * + * @see \Drupal\user\Entity\User */ -class UserAccessController extends EntityAccessController { +class UserAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} @@ -43,7 +45,7 @@ protected function checkAccess(EntityInterface $entity, $operation, $langcode, A /** * Check view access. * - * See EntityAccessControllerInterface::view() for parameters. + * See EntityAccessControlHandlerInterface::view() for parameters. */ protected function viewAccess(EntityInterface $entity, $langcode, AccountInterface $account) { // Never allow access to view the anonymous user account. diff --git a/core/modules/views/src/Entity/View.php b/core/modules/views/src/Entity/View.php index 0f783ffaa374043825a95902d92059a74f45a985..5bb0a9444790c65acba880530db47e85247a277f 100644 --- a/core/modules/views/src/Entity/View.php +++ b/core/modules/views/src/Entity/View.php @@ -20,7 +20,7 @@ * id = "view", * label = @Translation("View"), * controllers = { - * "access" = "Drupal\views\ViewAccessController" + * "access" = "Drupal\views\ViewAccessControlHandler" * }, * admin_permission = "administer views", * entity_keys = { diff --git a/core/modules/views/src/ViewAccessController.php b/core/modules/views/src/ViewAccessControlHandler.php similarity index 58% rename from core/modules/views/src/ViewAccessController.php rename to core/modules/views/src/ViewAccessControlHandler.php index 3b222030c9eb02115cc988018bae0c987b995e0b..1532301ffb610c312526e403f84840720c4e0028 100644 --- a/core/modules/views/src/ViewAccessController.php +++ b/core/modules/views/src/ViewAccessControlHandler.php @@ -2,19 +2,21 @@ /** * @file - * Contains \Drupal\views\ViewAccessController. + * Contains \Drupal\views\ViewAccessControlHandler. */ namespace Drupal\views; -use Drupal\Core\Entity\EntityAccessController; +use Drupal\Core\Entity\EntityAccessControlHandler; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; /** - * Defines the access controller for the view entity type. + * Defines the access control handler for the view entity type. + * + * @see \Drupal\views\Entity\View */ -class ViewAccessController extends EntityAccessController { +class ViewAccessControlHandler extends EntityAccessControlHandler { /** * {@inheritdoc} diff --git a/core/scripts/switch-psr4.sh b/core/scripts/switch-psr4.sh index eb1a4803b1c7df6962221ce02821f8df3abfa2fc..d9c4e1c391c99045248fcf8dcd4e36efe3eca560 100644 --- a/core/scripts/switch-psr4.sh +++ b/core/scripts/switch-psr4.sh @@ -8,7 +8,7 @@ * Moves module-provided class files to their PSR-4 location. * * E.g.: - * core/modules/action/{lib/Drupal/action → src}/ActionAccessController.php + * core/modules/action/{lib/Drupal/action → src}/ActionAccessControlHandler.php * core/modules/action/{lib/Drupal/action → src}/ActionAddForm.php */ diff --git a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php index 742426ba2cedc5bf3ead09d64daceab9bdf3a810..aeee601a4bfc724519ea93afe0733ad3b0837bc3 100644 --- a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php @@ -368,7 +368,7 @@ public function testBundle() { * @covers ::access */ public function testAccess() { - $access = $this->getMock('\Drupal\Core\Entity\EntityAccessControllerInterface'); + $access = $this->getMock('\Drupal\Core\Entity\EntityAccessControlHandlerInterface'); $operation = $this->randomMachineName(); $access->expects($this->at(0)) ->method('access') @@ -378,7 +378,7 @@ public function testAccess() { ->method('createAccess') ->will($this->returnValue(TRUE)); $this->entityManager->expects($this->exactly(2)) - ->method('getAccessController') + ->method('getAccessControlHandler') ->will($this->returnValue($access)); $this->assertTrue($this->entity->access($operation)); $this->assertTrue($this->entity->access('create')); diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php index e195e4c33be6d74a3a24fb522b5be723bb22786b..bf2ebf3cecace4409d0f5c2d4c864c77ee397415 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php @@ -15,6 +15,7 @@ /** * @coversDefaultClass \Drupal\Core\Entity\EntityCreateAccessCheck + * * @group Entity */ class EntityCreateAccessCheckTest extends UnitTestCase { @@ -48,7 +49,7 @@ public function providerTestAccess() { array('test_entity', 'entity_test:{bundle_argument}', FALSE, AccessCheckInterface::DENY), array('', 'entity_test:{bundle_argument}', FALSE, AccessCheckInterface::DENY), // When the bundle is not provided, access should be denied even if the - // access controller would allow access. + // access control handler would allow access. array('', 'entity_test:{bundle_argument}', TRUE, AccessCheckInterface::DENY), ); } @@ -61,18 +62,18 @@ public function providerTestAccess() { public function testAccess($entity_bundle, $requirement, $access, $expected) { $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); - // Don't expect a call to the access controller when we have a bundle + // Don't expect a call to the access control handler when we have a bundle // argument requirement but no bundle is provided. if ($entity_bundle || strpos($requirement, '{') === FALSE) { - $access_controller = $this->getMock('Drupal\Core\Entity\EntityAccessControllerInterface'); - $access_controller->expects($this->once()) + $access_control_handler = $this->getMock('Drupal\Core\Entity\EntityAccessControlHandlerInterface'); + $access_control_handler->expects($this->once()) ->method('createAccess') ->with($entity_bundle) ->will($this->returnValue($access)); $entity_manager->expects($this->any()) - ->method('getAccessController') - ->will($this->returnValue($access_controller)); + ->method('getAccessControlHandler') + ->will($this->returnValue($access_control_handler)); } $applies_check = new EntityCreateAccessCheck($entity_manager); diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php index ce1b5734bb5d6000db134ac8d7336e595d705b3a..c86a29394dc5b774de44dfa07446519f8d21440e 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php @@ -323,19 +323,19 @@ public function testGetViewBuilder() { } /** - * Tests the getAccessController() method. + * Tests the getAccessControlHandler() method. * - * @covers ::getAccessController() + * @covers ::getAccessControlHandler() */ - public function testGetAccessController() { + public function testGetAccessControlHandler() { $class = $this->getTestControllerClass(); $entity = $this->getMock('Drupal\Core\Entity\EntityTypeInterface'); $entity->expects($this->once()) - ->method('getAccessClass') + ->method('getAccessControlClass') ->will($this->returnValue($class)); $this->setUpEntityManager(array('test_entity_type' => $entity)); - $this->assertInstanceOf($class, $this->entityManager->getAccessController('test_entity_type')); + $this->assertInstanceOf($class, $this->entityManager->getAccessControlHandler('test_entity_type')); } /** diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php index 0709a145187fa3e7791a2864a222cbbb5cd934d8..82c93216b38e72f537c68b3fad4223cc6b94fe9f 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php @@ -131,16 +131,16 @@ public function testGetListBuilderClass() { } /** - * Tests the getAccessClass() method. + * Tests the getAccessControlClass() method. */ - public function testGetAccessClass() { + public function testGetAccessControlClass() { $controller = $this->getTestControllerClass(); $entity_type = $this->setUpEntityType(array( 'controllers' => array( 'access' => $controller, ), )); - $this->assertSame($controller, $entity_type->getAccessClass()); + $this->assertSame($controller, $entity_type->getAccessControlClass()); } /** diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php index 0e6a67f586ee86265cdecd7e63a62d9f1e16726e..a6626f6760d79eda6f39c92cca5baabad2e6ce4a 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php @@ -207,7 +207,7 @@ public function testLabel() { * @covers ::access */ public function testAccess() { - $access = $this->getMock('\Drupal\Core\Entity\EntityAccessControllerInterface'); + $access = $this->getMock('\Drupal\Core\Entity\EntityAccessControlHandlerInterface'); $operation = $this->randomMachineName(); $access->expects($this->at(0)) ->method('access') @@ -217,7 +217,7 @@ public function testAccess() { ->method('createAccess') ->will($this->returnValue(TRUE)); $this->entityManager->expects($this->exactly(2)) - ->method('getAccessController') + ->method('getAccessControlHandler') ->will($this->returnValue($access)); $this->assertTrue($this->entity->access($operation)); $this->assertTrue($this->entity->access('create'));