You are here

function administerusersbyrole_perm in Administer Users by Role 6

Same name and namespace in other branches
  1. 5 administerusersbyrole.module \administerusersbyrole_perm()

Implements hook_perm().

File

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

Code

function administerusersbyrole_perm() {
  $roles = db_query('SELECT name FROM {role} WHERE rid > 2 ORDER BY name');
  $perms = array();
  $perms[] = 'create users';
  $perms[] = 'edit users with no custom roles';
  $perms[] = 'delete users with no custom roles';
  while ($role = db_fetch_array($roles)) {
    $perms[] = _administerusersbyrole_build_perm_string($role['name'], 'edit', FALSE);
    $perms[] = _administerusersbyrole_build_perm_string($role['name'], 'edit', TRUE);
    $perms[] = _administerusersbyrole_build_perm_string($role['name'], 'delete', FALSE);
    $perms[] = _administerusersbyrole_build_perm_string($role['name'], 'delete', TRUE);
  }
  return $perms;
}