You are here

function _role_delegation_make_perm in Role Delegation 5

Same name and namespace in other branches
  1. 6 role_delegation.module \_role_delegation_make_perm()

Returns the delegation permission for a role. Any characters from the role that are not allowed in permission names are filtered out.

3 calls to _role_delegation_make_perm()
role_delegation_form_alter in ./role_delegation.module
Implementation of hook_form_alter().
role_delegation_perm in ./role_delegation.module
Implementation of hook_perm().
role_delegation_roles_form in ./role_delegation.module
Provides a form for assigning roles to the current user.

File

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

Code

function _role_delegation_make_perm($role) {

  // Allow alphanumerics, space, hyphen, underscore.
  $role = preg_replace('/[^a-zA-Z0-9 \\-_]/', '', $role);
  return "assign {$role} role";
}