You are here

function _autoassignrole_clean_roles in Auto Assign Role 6

Same name and namespace in other branches
  1. 6.2 autoassignrole.module \_autoassignrole_clean_roles()
5 calls to _autoassignrole_clean_roles()
autoassignrole_get_active_path_roles in ./autoassignrole.module
Get all roles that will be assigned based on the active path
autoassignrole_get_all_roles in ./autoassignrole.module
Get all assignable roles that AAR can possibly apply.
autoassignrole_get_auto_roles in ./autoassignrole.module
Get all assignable roles that AAR will apply automatically.
autoassignrole_get_path_roles in ./autoassignrole.module
Get all path assignable roles
autoassignrole_get_user_selectable_roles in ./autoassignrole.module
Get all user selectable roles

File

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

Code

function _autoassignrole_clean_roles($aar_roles) {
  $roles = user_roles();

  // Use the results of user_roles() and unset anything not available from AAR
  foreach ($roles as $key => $role) {
    if (!array_key_exists($key, $aar_roles)) {
      unset($roles[$key]);
    }
  }
  return $roles;
}