You are here

function gdpr_consent_field_access in General Data Protection Regulation 7

Implements hook_field_access().

File

modules/gdpr_consent/gdpr_consent.module, line 250
Contains hook implementations and shared functions.

Code

function gdpr_consent_field_access($op, $field, $entity_type, $entity, $account) {
  if ($field['type'] == 'gdpr_user_consent' && $op == 'edit') {
    if (user_access('manage gdpr agreements', $account) || user_access('grant any consent', $account)) {
      return TRUE;
    }

    // @todo Check grant own consent when we can consistently find the user.
    return TRUE;
  }
}