You are here

function gdpr_tasks_sars_callback_user_roles in General Data Protection Regulation 7

GDPR SARs render callback for user roles.

1 string reference to 'gdpr_tasks_sars_callback_user_roles'
gdpr_tasks_entity_property_info_alter in modules/gdpr_tasks/gdpr_tasks.module
Implements hook_entity_property_info_alter().

File

modules/gdpr_tasks/gdpr_tasks.module, line 888
Module file for the GDPR Tasks module.

Code

function gdpr_tasks_sars_callback_user_roles(EntityMetadataWrapper $value) {
  $rid = $value
    ->value();
  if (in_array($rid, array(
    DRUPAL_ANONYMOUS_RID,
    DRUPAL_AUTHENTICATED_RID,
  ))) {
    return NULL;
  }
  $role = user_role_load($rid);
  return $role->name;
}