Project

General

Profile

Revision b0dc3a2e

Added by Julien Enselme over 7 years ago

Update to Drupal 7.52

View differences:

drupal7/modules/field_ui/field_ui.module
106 106
          $access = array_intersect_key($bundle_info['admin'], drupal_map_assoc(array('access callback', 'access arguments')));
107 107
          $access += array(
108 108
            'access callback' => 'user_access',
109
            'access arguments' => array('administer site configuration'),
109
            'access arguments' => array('administer fields'),
110 110
          );
111 111

  
112
          // Add the "administer fields" permission on top of the access
113
          // restriction because the field UI should only be accessible to
114
          // trusted users.
115
          if ($access['access callback'] != 'user_access' || $access['access arguments'] != array('administer fields')) {
116
            $access = array(
117
              'access callback' => 'field_ui_admin_access',
118
              'access arguments' => array($access['access callback'], $access['access arguments']),
119
            );
120
          }
121

  
112 122
          $items["$path/fields"] = array(
113 123
            'title' => 'Manage fields',
114 124
            'page callback' => 'drupal_get_form',
......
392 402
    $form_state['redirect'] = _field_ui_bundle_admin_path('node', $form_state['values']['type']) .'/fields';
393 403
  }
394 404
}
405

  
406
/**
407
 * Access callback to determine if a user is allowed to use the field UI.
408
 *
409
 * Only grant access if the user has both the "administer fields" permission and
410
 * is granted access by the entity specific restrictions.
411
 */
412
function field_ui_admin_access($access_callback, $access_arguments) {
413
  return user_access('administer fields') && call_user_func_array($access_callback, $access_arguments);
414
}

Also available in: Unified diff