summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-07-21 12:42:10 +0100
committerAlex Pott2014-07-21 12:42:10 +0100
commit53b024dbd88a53ca6055cdc8e62c4c0107b16044 (patch)
treec8ecc2d0163b3a8b5819abe150f5ea28d0c6ba76
parent447cfbf1c1ad1085ab3909a0e21662e4124e9eb1 (diff)
Issue #2306429 by KarlKedrovsky, a_thakur: Remove user_access().
-rw-r--r--core/modules/user/user.module26
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php2
2 files changed, 1 insertions, 27 deletions
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index cbb1b2d..9209a39 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -417,32 +417,6 @@ function _user_role_permissions_update($roles) {
}
/**
- * 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.
*
* @param $name
diff --git a/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php b/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php
index 48071ae..ffbfb03 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php
@@ -203,7 +203,7 @@ class RoutingFixtures {
'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,