You are here

function role_delegation_permission in Role Delegation 7

Implements hook_permission().

1 call to role_delegation_permission()
role_delegation_access in ./role_delegation.module
Access callback for menu hook.

File

./role_delegation.module, line 40
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_permission() {
  $roles = _role_delegation_roles();
  $perms['assign all roles'] = array(
    'title' => t('Assign all roles'),
    'restrict access' => TRUE,
  );
  foreach ($roles as $rid => $role) {
    $perms["assign {$role} role"] = array(
      'title' => t('Assign %role role', array(
        '%role' => $role,
      )),
    );
  }
  return $perms;
}