You are here

function _roleassign_help in RoleAssign 7

Same name and namespace in other branches
  1. 7.2 roleassign.admin.inc \_roleassign_help()

Really implements hook_help().

Returns various help texts.

Parameters

string $path:

$arg:

Return value

string|null

1 call to _roleassign_help()
roleassign_help in ./roleassign.module
Implements hook_help().

File

./roleassign.admin.inc, line 250
Allows site administrators to further delegate the task of managing user's roles.

Code

function _roleassign_help($path = "admin/help#roleassign", $arg) {
  $perms = user_permission();
  $variables['%Administer_users'] = $perms['administer users']['title'];
  $variables['%Administer_permissions'] = $perms['administer permissions']['title'];
  $perms = roleassign_permission();
  $variables['%Assign_roles'] = $perms['assign roles']['title'];
  $variables['!help'] = l(t('help page'), 'admin/help/roleassign');
  switch ($path) {
    case 'admin/people/permissions/roleassign':
      return t('Users with both %Administer_users and %Assign_roles permissions are allowed to assign the roles selected below. For more information, see the !help.', $variables);
    case 'admin/help#roleassign':
      return t('
<p>RoleAssign specifically allows site administrators to further delegate the task of managing user\'s roles.</p>
<p>RoleAssign introduces a new permission called %Assign_roles. Users with this permission are able to assign selected roles to still other users. Only users with the %Administer_permissions permission may select which roles are available for assignment through this module.</p>
<h2>Background</h2>
<p>It is possible for site administrators to delegate the user administration through the %Administer_users permission. But that doesn\'t include the right to assign roles to users. That is necessary if the delegatee should be able to administrate user accounts without intervention from a site administrator.</p>
<p>To delegate the assignment of roles, site administrators have had until now no other choice than also grant the %Administer_permissions permission. But that is not advisable, since it gives right to access all roles, and worse, to grant any rights to any role. That can be abused by the delegatee, who can assign himself all rights and thereby take control over the site.</p>
<p>This module solves this dilemma by introducing the %Assign_roles permission. While editing a user\'s account information, a user with this permission will be able to select roles for the user from a set of available roles. Roles available are configured by users with the %Administer_permissions permission.</p>
<h2>Install</h2>
<ol>
  <li>Copy the entire !roleassign directory, containing the !roleassign_module and other files, to your Drupal modules directory.</li>
  <li>Log in as site administrator.</li>
  <li>Go to the administration page for modules and enable the module.</li>
</ol>
<h2>Configuration</h2>
<ol>
  <li>Log in as site administrator.</li>
  <li>Go to the administration page for access control and grant %Assign_roles permission to those roles that should be able to assign roles to other users. Notice that besides the %Assign_roles permission, these roles also must have the %Administer_users permission.</li>
  <li>Go to the administration page for role assign and select those roles that should be available for assignment by users with %Assign_roles permission.</li>
  <li>For each user that should be able to assign roles, go to the user\'s account and select a role with both the %Assign_roles and the %Administer_users permissions.</li>
</ol>
<p><strong>Beware:</strong> granting %Administer_users permission to users will allow them to modify admin passwords or email addresses or even delete the site administrator account. The !User_protect module can prevent this.</p>
<h2>Usage</h2>
<ol>
  <li>Log in as a user with both the %Assign_roles and the %Administer_users permissions.</li>
  <li>To change the roles of a user, go to the user\'s account and review the assignable roles and change them as necessary.</li>
</ol>', $variables + array(
        '!roleassign' => '<code>roleassign</code>',
        '!roleassign_module' => '<code>roleassign.module</code>',
        '!User_protect' => '<a href="http://drupal.org/project/userprotect">User protect</a>',
      ));
  }
  return NULL;
}