You are here

function _administerusersbyrole_build_perm_string in Administer Users by Role 6

Same name and namespace in other branches
  1. 8.2 administerusersbyrole.module \_administerusersbyrole_build_perm_string()
  2. 7.2 administerusersbyrole.module \_administerusersbyrole_build_perm_string()
  3. 7 administerusersbyrole.module \_administerusersbyrole_build_perm_string()

Generates a permission string for a given a role name.

5 calls to _administerusersbyrole_build_perm_string()
AdministerUsersByRoleTestCase::createRolesAndUsers in ./administerusersbyrole.test
AdministerUsersByRoleTestCase::setUp in ./administerusersbyrole.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
administerusersbyrole_perm in ./administerusersbyrole.module
Implements hook_perm().
_administerusersbyrole_can_delete_user in ./administerusersbyrole.module
_administerusersbyrole_can_edit_user in ./administerusersbyrole.module

File

./administerusersbyrole.module, line 167
Non-displayable characters.

Code

function _administerusersbyrole_build_perm_string($role_name, $op = 'edit', $other = FALSE) {
  $perm = "{$op} users with role ";
  $perm .= preg_replace('/[^a-zA-Z0-9]/', '', $role_name);
  if ($other) {
    $perm .= ' and other roles';
  }
  return $perm;
}