summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2013-08-31 06:24:23 (GMT)
committerwebchick2013-08-31 06:24:23 (GMT)
commitecd0aecccdf2500de5ca7b55477a7e10e298383c (patch)
treec69de46157ffcd137fa3a6a99088e1cb6f05c036
parentcd840f0828ec597345bad5718d1318a9e0dc623e (diff)
Issue #2062011 by InternetDevels, Albert Volkman: Replace user_access() calls with ->hasPermission() in path module.
-rw-r--r--core/modules/path/path.module6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/modules/path/path.module b/core/modules/path/path.module
index 38ebaa2..e6a1063 100644
--- a/core/modules/path/path.module
+++ b/core/modules/path/path.module
@@ -114,6 +114,7 @@ function path_form_node_form_alter(&$form, $form_state) {
'langcode' => $node->language()->id,
);
+ $account = Drupal::currentUser();
$form['path'] = array(
'#type' => 'details',
'#title' => t('URL path settings'),
@@ -125,7 +126,7 @@ function path_form_node_form_alter(&$form, $form_state) {
'#attached' => array(
'library' => array(array('path', 'drupal.path')),
),
- '#access' => user_access('create url aliases') || user_access('administer url aliases'),
+ '#access' => $account->hasPermission('create url aliases') || $account->hasPermission('administer url aliases'),
'#weight' => 30,
'#tree' => TRUE,
'#element_validate' => array('path_form_element_validate'),
@@ -183,6 +184,7 @@ function path_form_element_validate($element, &$form_state, $complete_form) {
* Implements hook_form_FORM_ID_alter() for taxonomy_term_form().
*/
function path_form_taxonomy_term_form_alter(&$form, $form_state) {
+ $account = Drupal::currentUser();
// Make sure this does not show up on the delete confirmation form.
if (empty($form_state['confirm_delete'])) {
$term = $form_state['controller']->getEntity();
@@ -197,7 +199,7 @@ function path_form_taxonomy_term_form_alter(&$form, $form_state) {
'langcode' => Language::LANGCODE_NOT_SPECIFIED,
);
$form['path'] = array(
- '#access' => user_access('create url aliases') || user_access('administer url aliases'),
+ '#access' => $account->hasPermission('create url aliases') || $account->hasPermission('administer url aliases'),
'#tree' => TRUE,
'#element_validate' => array('path_form_element_validate'),
);