diff --git a/core/modules/user/user.module b/core/modules/user/user.module index cbb1b2da3a18d15ff1230bb50ea990431617d5c9..9209a39ceb16ffa59704dc4b4b748d87c0f22537 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -416,32 +416,6 @@ function _user_role_permissions_update($roles) { return $role_permissions; } -/** - * Determine whether the user has a given privilege. - * - * @param $string - * The permission, such as "administer nodes", being checked for. - * @param \Drupal\Core\Session\AccountInterface $account - * (optional) The account to check, if not given use currently logged in user. - * - * @return bool - * Boolean TRUE if the current user has the requested permission. - * - * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0. - * Use \Drupal\Core\Session\AccountInterface::hasPermission(). - */ -function user_access($string, AccountInterface $account = NULL) { - global $user; - - if (!isset($account)) { - // In the installer request session is not set, so we have to fall back - // to the global $user. In all other cases the session key is preferred. - $account = \Drupal::currentUser() ?: $user; - } - - return $account->hasPermission($string); -} - /** * Checks for usernames blocked by user administration. * diff --git a/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php b/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php index 48071ae6b321c33332a3d0a1f3990b93f86296e2..ffbfb0369b41ba0cffc04bd6d83120bfdc453973 100644 --- a/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php +++ b/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php @@ -203,7 +203,7 @@ public function routingTableDefinition() { 'default' => '', ), 'access_callback' => array( - 'description' => 'The callback which determines the access to this router path. Defaults to user_access.', + 'description' => 'The callback which determines the access to this router path. Defaults to \Drupal\Core\Session\AccountInterface::hasPermission.', 'type' => 'varchar', 'length' => 255, 'not null' => TRUE,