Conversation
…covery and traversal.
…views integration.
| 'default' => NULL, | ||
| 'description' => 'The ID of consent agreement\'s default revision.', | ||
| ), | ||
| 'title' => array( |
There was a problem hiding this comment.
Presumably title should be revisionable also?
| 'title' => t('Grant Any Consent'), | ||
| ), | ||
| 'grant own consent' => array( | ||
| 'title' => t('Grant Own Consent'), |
There was a problem hiding this comment.
Why does this need to be a permission? Presumably all users should be able to grant their own consent?
| $info = array(); | ||
| $properties = &$info['gdpr_consent_agreement']['properties']; | ||
|
|
||
| $properties['id'] = array( |
There was a problem hiding this comment.
Should revision_id also be exposed?
| $element[$delta] = array( | ||
| '#type' => 'html_tag', | ||
| '#tag' => 'p', | ||
| '#value' => t('User Consent ID: @entity', array('@entity' => $item['target_id'])), |
There was a problem hiding this comment.
Do we want a second formatter that includes who registered the consent + notes etc?
| '#default_value' => $notes, | ||
| '#weight' => 10, | ||
| '#description' => '', | ||
| '#access' => user_access('grant any consent', $user), |
There was a problem hiding this comment.
Should this also check the target user isn't themselves?
| $rand = new GDPRUtilRandom(); | ||
| $value = "anon_" . $rand->string(4); | ||
| // If the value is too long, tirm it. | ||
| if (isset($max_length) && strlen($value) > $max_length) { |
There was a problem hiding this comment.
Surely $max_length should be passed into $rand->string()?
| */ | ||
| $plugin = array( | ||
| 'handler' => array( | ||
| 'class' => 'GDPRSanitizerDefault', |
There was a problem hiding this comment.
A 4 character random password is not a good idea...
| /** | ||
| * Defines a utility class for creating random data. | ||
| */ | ||
| class GDPRUtilRandom { |
There was a problem hiding this comment.
It's a shame Drupal 8's components aren't available separately :(
| /** | ||
| * Class for storing GDPR default sanitizer definition. | ||
| */ | ||
| class GDPRSanitizerDefault { |
| * The sanitized input. | ||
| */ | ||
| public function sanitize($input, $field = NULL) { | ||
| return $input; |
There was a problem hiding this comment.
This should probably be either an abstract or throw an exception? Returning the input is probably dangerous for mis-configuration...
No description provided.