You are here

function autoassignrole_get_roles in Auto Assign Role 6.2

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

An API like call to return the roles a user has available or will be assigned

Parameters

$op: string active, all, auto, path, user

$path: array Optional array of paths to restrict selection to when using an $op of path

Return value

array An array of roles

File

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

Code

function autoassignrole_get_roles($op = 'all', $path = array()) {
  switch ($op) {
    case 'active':
      return autoassignrole_get_active_path_roles($path);
      break;
    case 'all':
      return autoassignrole_get_all_roles();
      break;
    case 'auto':
      return autoassignrole_get_auto_roles();
      break;
    case 'path':
      return autoassignrole_get_path_roles($path);
      break;
    case 'user':
      return autoassignrole_get_user_selectable_roles();
      break;
  }
}