diff --git a/core/includes/entity.api.php b/core/includes/entity.api.php index 3d2a56a..1287cea 100644 --- a/core/includes/entity.api.php +++ b/core/includes/entity.api.php @@ -548,14 +548,14 @@ function hook_entity_field_info_alter(&$info, $entity_type) { * \Drupal\Core\TypedData\AccessibleInterface::access() for possible values. * @param \Drupal\Core\Entity\Field\Type\Field $field * The entity field object on which the operation is to be performed. - * @param \Drupal\user\UserInterface $account + * @param \Drupal\Core\Session\AccountInterface $account * The user account to check. * * @return bool|NULL * TRUE if access should be allowed, FALSE if access should be denied and NULL * if the implementation has no opinion. */ -function hook_entity_field_access($operation, $field, $account) { +function hook_entity_field_access($operation, $field, \Drupal\Core\Session\AccountInterface $account) { if ($field->getName() == 'field_of_interest' && $operation == 'update') { return user_access('update field of interest', $account); } diff --git a/core/modules/contact/lib/Drupal/contact/CategoryAccessController.php b/core/modules/contact/lib/Drupal/contact/CategoryAccessController.php index 9009337..ca6ca90 100644 --- a/core/modules/contact/lib/Drupal/contact/CategoryAccessController.php +++ b/core/modules/contact/lib/Drupal/contact/CategoryAccessController.php @@ -9,8 +9,7 @@ use Drupal\Core\Entity\EntityAccessController; use Drupal\Core\Entity\EntityInterface; -use Drupal\user\UserInterface; - +use Drupal\Core\Session\AccountInterface; /** * Defines an access controller for the contact category entity. * @@ -21,7 +20,7 @@ class CategoryAccessController extends EntityAccessController { /** * {@inheritdoc} */ - public function checkAccess(EntityInterface $entity, $operation, $langcode, UserInterface $account) { + public function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) { if ($operation == 'delete' || $operation == 'update') { // Do not allow delete 'personal' category used for personal contact form. return user_access('administer contact forms', $account) && $entity->id() !== 'personal'; diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTestBase.php b/core/modules/node/lib/Drupal/node/Tests/NodeTestBase.php index 02a16da..93eb3dd 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTestBase.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTestBase.php @@ -7,6 +7,7 @@ namespace Drupal\node\Tests; +use Drupal\Core\Session\AccountInterface; use Drupal\simpletest\WebTestBase; /** @@ -41,13 +42,13 @@ function setUp() { * operation should be granted. * @param \Drupal\node\Plugin\Core\Entity\Node $node * The node object to check. - * @param \Drupal\user\UserInterface $account + * @param \Drupal\Core\Session\AccountInterface $account * The user account for which to check access. * @param string|null $langcode * (optional) The language code indicating which translation of the node * to check. If NULL, the untranslated (fallback) access is checked. */ - function assertNodeAccess(array $ops, $node, $account, $langcode = NULL) { + function assertNodeAccess(array $ops, $node, AccountInterface $account, $langcode = NULL) { foreach ($ops as $op => $result) { $msg = format_string( 'node_access() returns @result with operation %op, language code %langcode.', diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module index 4cf68c2..e762d6c 100644 --- a/core/modules/overlay/overlay.module +++ b/core/modules/overlay/overlay.module @@ -8,7 +8,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Drupal\block\Plugin\Core\Entity\Block; -use Drupal\user\UserInterface; +use Drupal\Core\Session\AccountInterface; /** * Implements hook_help(). @@ -402,7 +402,7 @@ function theme_overlay_disable_message($variables) { /** * Implements hook_block_access(). */ -function overlay_block_access(Block $block, $operation, UserInterface $account, $langcode) { +function overlay_block_access(Block $block, $operation, AccountInterface $account, $langcode) { // If we are limiting rendering to a subset of page regions, hide all blocks // which appear in regions not on that list. Note that overlay_page_alter() // does a more comprehensive job of preventing unwanted regions from being diff --git a/core/modules/translation_entity/translation_entity.module b/core/modules/translation_entity/translation_entity.module index 1ef2df5..b5fc05f 100644 --- a/core/modules/translation_entity/translation_entity.module +++ b/core/modules/translation_entity/translation_entity.module @@ -6,6 +6,7 @@ */ use Drupal\Core\Language\Language; +use Drupal\Core\Session\AccountInterface; use Drupal\Core\Entity\EntityFormControllerInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityNG; @@ -289,11 +290,11 @@ function translation_entity_translate_access(EntityInterface $entity) { * The entity whose translation overview should be displayed. * @param $langcode * The language code of the translation to be displayed. - * @param \Drupal\user\UserInterface $account + * @param \Drupal\Core\Session\AccountInterface $account * (optional) The account for which view access should be checked. Defaults to * the current user. */ -function translation_entity_view_access(EntityInterface $entity, $langcode, $account = NULL) { +function translation_entity_view_access(EntityInterface $entity, $langcode, AccountInterface $account = NULL) { $entity_type = $entity->entityType(); return !empty($entity->translation[$langcode]['status']) || user_access('translate any entity', $account) || user_access("translate $entity_type entities", $account); } diff --git a/core/modules/user/lib/Drupal/user/RoleAccessController.php b/core/modules/user/lib/Drupal/user/RoleAccessController.php index 64973df..13afa61 100644 --- a/core/modules/user/lib/Drupal/user/RoleAccessController.php +++ b/core/modules/user/lib/Drupal/user/RoleAccessController.php @@ -9,7 +9,7 @@ use Drupal\Core\Entity\EntityAccessController; use Drupal\Core\Entity\EntityInterface; -use Drupal\user\Plugin\Core\Entity\User; +use Drupal\Core\Session\AccountInterface; /** * Defines the access controller for the user_role entity type. @@ -19,7 +19,7 @@ class RoleAccessController extends EntityAccessController { /** * {@inheritdoc} */ - protected function checkAccess(EntityInterface $entity, $operation, $langcode, UserInterface $account) { + protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) { switch ($operation) { case 'delete': if ($entity->id() == DRUPAL_ANONYMOUS_RID || $entity->id() == DRUPAL_AUTHENTICATED_RID) { diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php index 3879b59..ae61b93 100644 --- a/core/modules/user/user.api.php +++ b/core/modules/user/user.api.php @@ -361,7 +361,7 @@ function hook_user_view(\Drupal\user\UserInterface $account, \Drupal\entity\Plug * @see user_view() * @see hook_entity_view_alter() */ -function hook_user_view_alter(&$build, \Drupal\user\Plugin\Core\Entity\User $account, \Drupal\entity\Plugin\Core\Entity\EntityDisplay $display) { +function hook_user_view_alter(&$build, \Drupal\user\UserInterface $account, \Drupal\entity\Plugin\Core\Entity\EntityDisplay $display) { // Check for the existence of a field added by another module. if (isset($build['an_additional_field'])) { // Change its weight.