diff --git a/core/modules/comment/lib/Drupal/comment/CommentAccessController.php b/core/modules/comment/lib/Drupal/comment/CommentAccessController.php index 791dc4d..a2b4ce1 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentAccessController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentAccessController.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; /** * Access controller for the comment entity. @@ -21,21 +21,21 @@ class CommentAccessController extends EntityAccessController implements CommentA /** * Overrides \Drupal\Core\Entity\EntityAccessController::viewAccess(). */ - public function viewAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, User $account = NULL) { + public function viewAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, AccountInterface $account = NULL) { return user_access('access comments', $account); } /** * Overrides \Drupal\Core\Entity\EntityAccessController::createAccess(). */ - public function createAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, User $account = NULL) { + public function createAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, AccountInterface $account = NULL) { return user_access('post comments', $account); } /** * Overrides \Drupal\Core\Entity\EntityAccessController::updateAccess(). */ - public function updateAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, User $account = NULL) { + public function updateAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, AccountInterface $account = NULL) { // If no user is specified fill in the current one. if (!isset($account)) { $account = $GLOBALS['user']; @@ -46,14 +46,14 @@ public function updateAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAU /** * Overrides \Drupal\Core\Entity\EntityAccessController::deleteAccess(). */ - public function deleteAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, User $account = NULL) { + public function deleteAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, AccountInterface $account = NULL) { return user_access('administer comments', $account); } /** * Implements \Drupal\comment\CommentAccessControllerInterface::approveAccess(). */ - public function approveAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, User $account = NULL) { + public function approveAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, AccountInterface $account = NULL) { return user_access('administer comments', $account); } diff --git a/core/modules/comment/lib/Drupal/comment/CommentAccessControllerInterface.php b/core/modules/comment/lib/Drupal/comment/CommentAccessControllerInterface.php index f611471..68aad33 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentAccessControllerInterface.php +++ b/core/modules/comment/lib/Drupal/comment/CommentAccessControllerInterface.php @@ -9,7 +9,7 @@ use Drupal\Core\Entity\EntityAccessControllerInterface; use Drupal\Core\Entity\EntityInterface; -use Drupal\user\Plugin\Core\Entity\User; +use Drupal\Core\Session\AccountInterface; /** * Defines an interface for comment access controller. @@ -27,13 +27,13 @@ * @param string $langcode * (optional) The language code for which to check access. Defaults to * LANGUAGE_DEFAULT. - * @param \Drupal\user\Plugin\Core\Entity\User $account + * @param \Drupal\Core\Session\AccountInterface; $account * (optional) The user for which to check access, or NULL to check access * for the current user. Defaults to NULL. * * @return bool * TRUE if access was granted, FALSE otherwise. */ - public function approveAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, User $account = NULL); + public function approveAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, AccountInterface $account = NULL); }