You are here

function entity_metadata_user_roles in Entity API 7

Options list callback returning all user roles.

1 string reference to 'entity_metadata_user_roles'
entity_metadata_user_entity_property_info in modules/user.info.inc
Implements hook_entity_property_info() on top of user module.

File

modules/callbacks.inc, line 410
Provides various callbacks for the whole core module integration.

Code

function entity_metadata_user_roles($property_name = 'roles', $info = array(), $op = 'edit') {
  $roles = user_roles();
  if ($op == 'edit') {
    unset($roles[DRUPAL_AUTHENTICATED_RID], $roles[DRUPAL_ANONYMOUS_RID]);
  }
  return $roles;
}