You are here

function autoassignrole_get_user_selectable_roles in Auto Assign Role 6.2

Same name and namespace in other branches
  1. 6 autoassignrole.module \autoassignrole_get_user_selectable_roles()

Get all user selectable roles

Return value

array An array of roles

1 call to autoassignrole_get_user_selectable_roles()
autoassignrole_get_roles in ./autoassignrole.module
An API like call to return the roles a user has available or will be assigned

File

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

Code

function autoassignrole_get_user_selectable_roles() {
  $aar_roles = array();

  // Select all user selectable roles
  $sql = "SELECT value FROM {autoassignrole} WHERE arid = 'user_roles'";
  $result = db_fetch_object(db_query($sql));
  $aar_roles = unserialize($result->value);
  return _autoassignrole_clean_roles($aar_roles);
}