function _administerusersbyrole_build_perm_string in Administer Users by Role 7
Same name and namespace in other branches
- 8.2 administerusersbyrole.module \_administerusersbyrole_build_perm_string()
- 6 administerusersbyrole.module \_administerusersbyrole_build_perm_string()
- 7.2 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 - Sets up a Drupal site for running functional and integration tests.
- administerusersbyrole_permission in ./
administerusersbyrole.module - Implements hook_permission().
- _administerusersbyrole_can_cancel_user in ./
administerusersbyrole.module - _administerusersbyrole_can_edit_user in ./
administerusersbyrole.module
File
- ./
administerusersbyrole.module, line 162 - Provides fine-grained permissions for creating, editing, and deleting users.
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;
}