You are here

function _role_delegation_roles in Role Delegation 7

Same name and namespace in other branches
  1. 5 role_delegation.module \_role_delegation_roles()
  2. 6 role_delegation.module \_role_delegation_roles()

Returns all existing roles, except anonymous and authenticated user.

5 calls to _role_delegation_roles()
role_delegation_delegate_roles_action_form in ./role_delegation.module
role_delegation_form_user_admin_account_alter in ./role_delegation.module
Implements hook_form_FORM_ID_alter() for user_admin_account().
role_delegation_permission in ./role_delegation.module
Implements hook_permission().
role_delegation_user_operations in ./role_delegation.module
Implements hook_user_operations().
_role_delegation_add_roles_to_form in ./role_delegation.module
Helper function to create the role options.

File

./role_delegation.module, line 169
This module allows site administrators to grant some roles the authority to change roles assigned to users, without them needing the 'administer access control' permission.

Code

function _role_delegation_roles() {
  $roles = user_roles(TRUE);
  unset($roles[DRUPAL_AUTHENTICATED_RID]);

  // Do not allow to delegate users to administator role. Let's keep this
  // privilege to users with 'Administer permissions' permission only.
  unset($roles[variable_get('user_admin_role', 0)]);
  return $roles;
}