You are here

function autoassignrole_get_roles in Auto Assign Role 7.2

Same name and namespace in other branches
  1. 6.2 autoassignrole.module \autoassignrole_get_roles()
  2. 6 autoassignrole.module \autoassignrole_get_roles()

Provides a list of roles having both keys and values as role name.

The list is suitable to be used as options list in form API. The built-in 'anonymous' and 'authenticated user' roles are filtered out.

Return value

array A list of roles.

3 calls to autoassignrole_get_roles()
autoassignrole_auto_settings in ./autoassignrole.admin.inc
Form builder; The settings form for automatic role assignment.
autoassignrole_page_form in ./autoassignrole.admin.inc
Provides a FAPI form for adding and editing pages.
autoassignrole_user_settings in ./autoassignrole.admin.inc
Form builder; The settings form for user selectable role assignment.

File

./autoassignrole.module, line 428
The main autoassignrole.module file

Code

function autoassignrole_get_roles() {
  $roles = user_roles(TRUE);
  unset($roles[DRUPAL_AUTHENTICATED_RID]);
  return drupal_map_assoc($roles);
}