Commit 92ad4274 authored by webchick's avatar webchick

#699842 by mr.baileys: Move permissions and roles to a tab/sub-tab at admin/people.

parent 2893abcc
......@@ -149,7 +149,7 @@ function dashboard_permission() {
return array(
'access dashboard' => array(
'title' => t('View the administrative dashboard'),
'description' => t('Note: modifying the dashboard requires the !administer_blocks permission.', array('!administer_blocks' => l(t('Administer blocks'), 'admin/config/people/permissions', array('fragment' => 'module-block')))),
'description' => t('Note: modifying the dashboard requires the !administer_blocks permission.', array('!administer_blocks' => l(t('Administer blocks'), 'admin/people/permissions', array('fragment' => 'module-block')))),
),
);
}
......
......@@ -286,7 +286,7 @@ class MenuTestCase extends DrupalWebTestCase {
* @param string $menu_name Menu name.
*/
function addInvalidMenuLink($menu_name = 'navigation') {
foreach (array('-&-', 'admin/config/people/permissions') as $link_path) {
foreach (array('-&-', 'admin/people/permissions') as $link_path) {
$edit = array(
'link_path' => $link_path,
'link_title' => 'title',
......
......@@ -94,7 +94,7 @@ function node_help($path, $arg) {
$output .= '<dt>' . t('Creating revisions') . '</dt>';
$output .= '<dd>' . t('The Node module also enables you to create multiple versions of any content, and revert to older versions using the <em>Revision information</em> settings.') . '</dd>';
$output .= '<dt>' . t('User permissions') . '</dt>';
$output .= '<dd>' . t('The Node module makes a number of permissions available for each content type, which can be set by role on the <a href="@permissions">permissions page</a>.', array('@permissions' => url('admin/config/people/permissions', array('fragment' => 'module-node')))) . '</dd>';
$output .= '<dd>' . t('The Node module makes a number of permissions available for each content type, which can be set by role on the <a href="@permissions">permissions page</a>.', array('@permissions' => url('admin/people/permissions', array('fragment' => 'module-node')))) . '</dd>';
$output .= '</dl>';
return $output;
......
......@@ -18,7 +18,7 @@ function path_help($path, $arg) {
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Creating aliases') . '</dt>';
$output .= '<dd>' . t('Users with sufficient <a href="@permissions">permissions</a> can create aliases under the <em>URL path settings</em> section when they create or edit content. Some examples of aliases are: ', array('@permissions' => url('admin/config/people/permissions', array('fragment' => 'module-path'))));
$output .= '<dd>' . t('Users with sufficient <a href="@permissions">permissions</a> can create aliases under the <em>URL path settings</em> section when they create or edit content. Some examples of aliases are: ', array('@permissions' => url('admin/people/permissions', array('fragment' => 'module-path'))));
$output .= '<ul><li>' . t('<em>member/jane-smith</em> aliased to internal path <em>user/123</em>') . '</li>';
$output .= '<li>' . t('<em>about-us/team</em> aliased to internal path <em>node/456</em>') . '</li>';
$output .= '</ul></dd>';
......
......@@ -517,7 +517,7 @@ class SearchCommentTestCase extends DrupalWebTestCase {
// seems to be added via node links.
DRUPAL_ANONYMOUS_RID . '[post comments]' => 1,
);
$this->drupalPost('admin/config/people/permissions', $edit, t('Save permissions'));
$this->drupalPost('admin/people/permissions', $edit, t('Save permissions'));
// Create a node.
$node = $this->drupalCreateNode(array('type' => 'article'));
......
......@@ -28,7 +28,7 @@ function statistics_help($path, $arg) {
$output .= '<dt>' . t('Displaying popular content') . '</dt>';
$output .= '<dd>' . t('The module includes a <em>Popular content</em> block that displays the most viewed pages today and for all time, and the last content viewed. To use the block, enable <em>Count content views</em> on the <a href="@statistics-settings">statistics settings page</a>, and then you can enable and configure the block on the <a href="@blocks">blocks administration page</a>.', array('@statistics-settings' => url('admin/config/system/statistics'), '@blocks' => url('admin/structure/block'))) . '</dd>';
$output .= '<dt>' . t('Page view counter') . '</dt>';
$output .= '<dd>' . t('The Statistics module includes a counter for each page that increases whenever the page is viewed. To use the counter, enable <em>Count content views</em> on the <a href="@statistics-settings">statistics settings page</a>, and set the necessary <a href="@permissions">permissions</a> (<em>View content hits</em>) so that the counter is visible to the users.', array('@statistics-settings' => url('admin/config/system/statistics'), '@permissions' => url('admin/config/people/permissions', array('fragment' => 'module-statistics')))) . '</dd>';
$output .= '<dd>' . t('The Statistics module includes a counter for each page that increases whenever the page is viewed. To use the counter, enable <em>Count content views</em> on the <a href="@statistics-settings">statistics settings page</a>, and set the necessary <a href="@permissions">permissions</a> (<em>View content hits</em>) so that the counter is visible to the users.', array('@statistics-settings' => url('admin/config/system/statistics'), '@permissions' => url('admin/people/permissions', array('fragment' => 'module-statistics')))) . '</dd>';
$output .= '</dl>';
return $output;
case 'admin/config/system/statistics':
......
......@@ -896,7 +896,7 @@ function system_modules($form, $form_state = array()) {
$extra['links']['permissions'] = array(
'#type' => 'link',
'#title' => t('Permissions'),
'#href' => 'admin/config/people/permissions',
'#href' => 'admin/people/permissions',
'#options' => array('fragment' => 'module-' . $filename, 'attributes' => array('class' => array('module-link', 'module-link-permissions'), 'title' => t('Configure permissions'))),
);
}
......@@ -2134,7 +2134,7 @@ function system_site_maintenance_mode() {
'#type' => 'checkbox',
'#title' => t('Put site into maintenance mode'),
'#default_value' => 0,
'#description' => t('When enabled, only users with the "Access site in maintenance mode" <a href="@permissions-url">permission</a> are able to access your site to perform maintenance; all other visitors see the maintenance mode message configured below. Authorized users can log in directly via the <a href="@user-login">user login</a> page.', array('@permissions-url' => url('admin/config/people/permissions'), '@user-login' => url('user'))),
'#description' => t('When enabled, only users with the "Access site in maintenance mode" <a href="@permissions-url">permission</a> are able to access your site to perform maintenance; all other visitors see the maintenance mode message configured below. Authorized users can log in directly via the <a href="@user-login">user login</a> page.', array('@permissions-url' => url('admin/people/permissions'), '@user-login' => url('user'))),
);
$form['maintenance_mode_message'] = array(
'#type' => 'textarea',
......
......@@ -2664,7 +2664,7 @@ function system_get_module_admin_tasks($module) {
$admin_task_count = 0;
// Check for permissions.
if (in_array($module, module_implements('permission')) && $admin_access) {
$admin_tasks[-1] = l(t('Configure permissions'), 'admin/config/people/permissions', array('fragment' => 'module-' . $module));
$admin_tasks[-1] = l(t('Configure permissions'), 'admin/people/permissions', array('fragment' => 'module-' . $module));
}
// Check for menu items that are admin links.
......
......@@ -18,7 +18,7 @@ function taxonomy_help($path, $arg) {
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Creating vocabularies') . '</dt>';
$output .= '<dd>' . t('Users with sufficient <a href="@perm">permissions</a> can create <em>vocabularies</em> and <em>terms</em> through the <a href="@taxo">Taxonomy page</a>. The page listing the terms provides a drag-and-drop interface for controlling the order of the terms and sub-terms within a vocabulary, in a hierarchical fashion. A <em>controlled vocabulary</em> classifying music by genre with terms and sub-terms could look as follows:', array('@taxo' => url('admin/structure/taxonomy'), '@perm' => url('admin/config/people/permissions', array('fragment'=>'module-taxonomy'))));
$output .= '<dd>' . t('Users with sufficient <a href="@perm">permissions</a> can create <em>vocabularies</em> and <em>terms</em> through the <a href="@taxo">Taxonomy page</a>. The page listing the terms provides a drag-and-drop interface for controlling the order of the terms and sub-terms within a vocabulary, in a hierarchical fashion. A <em>controlled vocabulary</em> classifying music by genre with terms and sub-terms could look as follows:', array('@taxo' => url('admin/structure/taxonomy'), '@perm' => url('admin/people/permissions', array('fragment'=>'module-taxonomy'))));
$output .= '<ul><li>' . t ('<em>vocabulary</em>: Music'); '</li>';
$output .= '<ul><li>' . t('<em>term</em>: Jazz') . '</li>';
$output .= '<ul><li>' . t('<em>sub-term</em>: Swing') . '</li>';
......
......@@ -315,7 +315,7 @@ function user_admin_settings() {
$form['registration_cancellation']['user_cancel_method'] = array(
'#type' => 'item',
'#title' => t('When cancelling a user account'),
'#description' => t('Users with the %select-cancel-method or %administer-users <a href="@permissions-url">permissions</a> can override this default method.', array('%select-cancel-method' => t('Select method for cancelling account'), '%administer-users' => t('Administer users'), '@permissions-url' => url('admin/config/people/permissions'))),
'#description' => t('Users with the %select-cancel-method or %administer-users <a href="@permissions-url">permissions</a> can override this default method.', array('%select-cancel-method' => t('Select method for cancelling account'), '%administer-users' => t('Administer users'), '@permissions-url' => url('admin/people/permissions'))),
);
$form['registration_cancellation']['user_cancel_method'] += user_cancel_methods();
foreach (element_children($form['registration_cancellation']['user_cancel_method']) as $element) {
......@@ -776,7 +776,7 @@ function user_admin_role() {
$rid = arg(5);
if ($rid) {
if ($rid == DRUPAL_ANONYMOUS_RID || $rid == DRUPAL_AUTHENTICATED_RID) {
drupal_goto('admin/config/people/roles');
drupal_goto('admin/people/permissions/roles');
}
// Display the edit role form.
$role = db_query('SELECT * FROM {role} WHERE rid = :rid', array(':rid' => $rid))->fetchObject();
......@@ -852,7 +852,7 @@ function user_admin_role_submit($form, &$form_state) {
user_role_save($role);
drupal_set_message(t('The role has been added.'));
}
$form_state['redirect'] = 'admin/config/people/roles';
$form_state['redirect'] = 'admin/people/permissions/roles';
return;
}
......@@ -866,12 +866,12 @@ function theme_user_admin_new_role($variables) {
$header = array(t('Name'), array('data' => t('Operations'), 'colspan' => 2));
foreach (user_roles() as $rid => $name) {
$edit_permissions = l(t('edit permissions'), 'admin/config/people/permissions/' . $rid);
$edit_permissions = l(t('edit permissions'), 'admin/people/permissions/' . $rid);
if (in_array($rid, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID))) {
$rows[] = array(t('!name %locked', array('!name' => $name, '%locked' => t('(locked)'))), '', $edit_permissions);
}
else {
$rows[] = array($name, l(t('edit role'), 'admin/config/people/roles/edit/' . $rid), $edit_permissions);
$rows[] = array($name, l(t('edit role'), 'admin/people/permissions/roles/edit/' . $rid), $edit_permissions);
}
}
$rows[] = array(array('data' => drupal_render($form['name']) . drupal_render($form['submit']), 'colspan' => 3, 'class' => 'edit-name'));
......
......@@ -30,19 +30,19 @@ function user_help($path, $arg) {
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Creating and managing users') . '</dt>';
$output .= '<dd>' . t('The User module allows users with the appropriate <a href="@permissions">permissions</a> to create user accounts through the <a href="@people">People administration page</a>, where they can also assign users to one or more roles, and block or delete user accounts. If allowed, users without accounts (anonymous users) can create their own accounts on the <a href="@register">Create new account</a> page.', array('@permissions' => url('admin/config/people/permissions', array('fragment' => 'module-user')), '@people' => url('admin/people'), '@register' => url('user/register'))) . '</dd>';
$output .= '<dd>' . t('The User module allows users with the appropriate <a href="@permissions">permissions</a> to create user accounts through the <a href="@people">People administration page</a>, where they can also assign users to one or more roles, and block or delete user accounts. If allowed, users without accounts (anonymous users) can create their own accounts on the <a href="@register">Create new account</a> page.', array('@permissions' => url('admin/people/permissions', array('fragment' => 'module-user')), '@people' => url('admin/people'), '@register' => url('user/register'))) . '</dd>';
$output .= '<dt>' . t('User roles and permissions') . '</dt>';
$output .= '<dd>' . t('<em>Roles</em> are used to group and classify users; each user can be assigned one or more roles. By default there are two roles: <em>anonymous user</em> (users that are not logged in) and <em>authenticated user</em> (users that are registered and logged in). Depending on choices you made when you installed Drupal, the installation process may have defined more roles, and you can create additional custom roles on the <a href="@roles">Roles page</a>. After creating roles, you can set permissions for each role on the <a href="@permissions_user">Permissions page</a>. Granting a permission allows users who have been assigned a particular role to perform an action on the site, such as viewing a particular type of content, editing or creating content, administering settings for a particular module, or using a particular function of the site (such as search).', array('@permissions_user' => url('admin/config/people/permissions'), '@roles' => url('admin/config/people/roles'))) . '</dd>';
$output .= '<dd>' . t('<em>Roles</em> are used to group and classify users; each user can be assigned one or more roles. By default there are two roles: <em>anonymous user</em> (users that are not logged in) and <em>authenticated user</em> (users that are registered and logged in). Depending on choices you made when you installed Drupal, the installation process may have defined more roles, and you can create additional custom roles on the <a href="@roles">Roles page</a>. After creating roles, you can set permissions for each role on the <a href="@permissions_user">Permissions page</a>. Granting a permission allows users who have been assigned a particular role to perform an action on the site, such as viewing a particular type of content, editing or creating content, administering settings for a particular module, or using a particular function of the site (such as search).', array('@permissions_user' => url('admin/config/people/permissions'), '@roles' => url('admin/people/roles'))) . '</dd>';
$output .= '<dt>' . t('Account settings') . '</dt>';
$output .= '<dd>' . t('The <a href="@accounts">Account settings page</a> allows you to manage settings for the displayed name of the anonymous user role, personal contact forms, user registration, and account cancellation. On this page you can also manage settings for account personalization (including signatures and user pictures), and adapt the text for the e-mail messages that are sent automatically during the user registration process.', array('@accounts' => url('admin/config/people/accounts'))) . '</dd>';
$output .= '<dd>' . t('The <a href="@accounts">Account settings page</a> allows you to manage settings for the displayed name of the anonymous user role, personal contact forms, user registration, and account cancellation. On this page you can also manage settings for account personalization (including signatures and user pictures), and adapt the text for the e-mail messages that are sent automatically during the user registration process.', array('@accounts' => url('admin/people/accounts'))) . '</dd>';
$output .= '</dl>';
return $output;
case 'admin/people/create':
return '<p>' . t("This web page allows administrators to register new users. Users' e-mail addresses and usernames must be unique.") . '</p>';
case 'admin/config/people/permissions':
return '<p>' . t('Permissions let you control what users can do and see on your site. You can define a specific set of permissions for each role. (See the <a href="@role">Roles</a> page to create a role). Two important roles to consider are Authenticated Users and Administrators. Any permissions granted to the Authenticated Users role will be given to any user who can log into your site. You can make any role the Administrator role for the site, meaning this will be granted all new permissions automatically. You can do this on the <a href="@settings">User Settings</a> page. You should be careful to ensure that only trusted users are given this access and level of control of your site.', array('@role' => url('admin/config/people/roles'), '@settings' => url('admin/config/people/accounts'))) . '</p>';
case 'admin/config/people/roles':
$output = '<p>' . t('Roles allow you to fine tune the security and administration of Drupal. A role defines a group of users that have certain privileges as defined in <a href="@permissions">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <em>role names</em> of the various roles. To delete a role choose "edit".', array('@permissions' => url('admin/config/people/permissions'))) . '</p>';
case 'admin/people/permissions':
return '<p>' . t('Permissions let you control what users can do and see on your site. You can define a specific set of permissions for each role. (See the <a href="@role">Roles</a> page to create a role). Two important roles to consider are Authenticated Users and Administrators. Any permissions granted to the Authenticated Users role will be given to any user who can log into your site. You can make any role the Administrator role for the site, meaning this will be granted all new permissions automatically. You can do this on the <a href="@settings">User Settings</a> page. You should be careful to ensure that only trusted users are given this access and level of control of your site.', array('@role' => url('admin/people/permissions/roles'), '@settings' => url('admin/config/people/accounts'))) . '</p>';
case 'admin/people/permissions/roles':
$output = '<p>' . t('Roles allow you to fine tune the security and administration of Drupal. A role defines a group of users that have certain privileges as defined in <a href="@permissions">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <em>role names</em> of the various roles. To delete a role choose "edit".', array('@permissions' => url('admin/people/permissions'))) . '</p>';
$output .= '<p>'. t('By default, Drupal comes with two user roles:') . '</p>';
$output .= '<ul>';
$output .= '<li>' . t("Anonymous user: this role is used for users that don't have a user account or that are not authenticated.") . '</li>';
......@@ -1480,6 +1480,39 @@ function user_menu() {
'weight' => -10,
'file' => 'user.admin.inc',
);
$items['admin/people/permissions'] = array(
'title' => 'Permissions',
'description' => 'Determine access to features by selecting permissions for roles.',
'page callback' => 'drupal_get_form',
'page arguments' => array('user_admin_permissions'),
'access arguments' => array('administer permissions'),
'file' => 'user.admin.inc',
'type' => MENU_LOCAL_TASK,
);
$items['admin/people/permissions/list'] = array(
'title' => 'Permissions',
'description' => 'Determine access to features by selecting permissions for roles.',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -8,
);
$items['admin/people/permissions/roles'] = array(
'title' => 'Roles',
'description' => 'List, edit, or add user roles.',
'page callback' => 'drupal_get_form',
'page arguments' => array('user_admin_new_role'),
'access arguments' => array('administer permissions'),
'file' => 'user.admin.inc',
'type' => MENU_LOCAL_TASK,
'weight' => -5,
);
$items['admin/people/permissions/roles/edit'] = array(
'title' => 'Edit role',
'page arguments' => array('user_admin_role'),
'access arguments' => array('administer permissions'),
'type' => MENU_CALLBACK,
);
$items['admin/people/create'] = array(
'title' => 'Add user',
'page arguments' => array('create'),
......@@ -1489,7 +1522,7 @@ function user_menu() {
// Administration pages.
$items['admin/config/people'] = array(
'title' => 'People and permissions',
'title' => 'People',
'description' => 'Configure user accounts, roles and permissions.',
'position' => 'right',
'page callback' => 'system_admin_menu_block_page',
......@@ -1512,32 +1545,6 @@ function user_menu() {
'weight' => -10,
);
// Permission administration pages.
$items['admin/config/people/roles'] = array(
'title' => 'Roles',
'description' => 'List, edit, or add user roles.',
'page callback' => 'drupal_get_form',
'page arguments' => array('user_admin_new_role'),
'access arguments' => array('administer permissions'),
'file' => 'user.admin.inc',
'weight' => -9,
);
$items['admin/config/people/roles/edit'] = array(
'title' => 'Edit role',
'page arguments' => array('user_admin_role'),
'access arguments' => array('administer permissions'),
'type' => MENU_CALLBACK,
);
$items['admin/config/people/permissions'] = array(
'title' => 'Permissions',
'description' => 'Determine access to features by selecting permissions for roles.',
'page callback' => 'drupal_get_form',
'page arguments' => array('user_admin_permissions'),
'access arguments' => array('administer permissions'),
'file' => 'user.admin.inc',
'weight' => -8,
);
// Use %user_uid_only_optional here to avoid loading the full user for
// basic access checks.
$items['user/%user_uid_only_optional'] = array(
......
......@@ -971,7 +971,7 @@ class UserPermissionsTestCase extends DrupalWebTestCase {
$this->assertFalse(user_access('administer nodes', $account), t('User does not have "administer nodes" permission.'));
$edit = array();
$edit[$rid . '[administer nodes]'] = TRUE;
$this->drupalPost('admin/config/people/permissions', $edit, t('Save permissions'));
$this->drupalPost('admin/people/permissions', $edit, t('Save permissions'));
$this->assertText(t('The changes have been saved.'), t('Successful save message displayed.'));
drupal_static_reset('user_access');
drupal_static_reset('user_role_permissions');
......@@ -981,7 +981,7 @@ class UserPermissionsTestCase extends DrupalWebTestCase {
$this->assertTrue(user_access('access user profiles', $account), t('User has "access user profiles" permission.'));
$edit = array();
$edit[$rid . '[access user profiles]'] = FALSE;
$this->drupalPost('admin/config/people/permissions', $edit, t('Save permissions'));
$this->drupalPost('admin/people/permissions', $edit, t('Save permissions'));
$this->assertText(t('The changes have been saved.'), t('Successful save message displayed.'));
drupal_static_reset('user_access');
drupal_static_reset('user_role_permissions');
......@@ -1210,7 +1210,7 @@ class UserBlocksUnitTests extends DrupalWebTestCase {
$edit = array();
$edit['name'] = $user->name;
$edit['pass'] = $user->pass_raw;
$this->drupalPost('admin/config/people/permissions', $edit, t('Log in'));
$this->drupalPost('admin/people/permissions', $edit, t('Log in'));
$this->assertNoText(t('User login'), t('Logged in.'));
// Check that we are still on the same page.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment