public function WebformSubmissionStorage::checkFieldDefinitionAccess in Webform 6.x
Same name and namespace in other branches
- 8.5 src/WebformSubmissionStorage.php \Drupal\webform\WebformSubmissionStorage::checkFieldDefinitionAccess()
Check field definition access.
Access checks include…
- Only allowing user who can update any access to the 'token' field.
Parameters
\Drupal\webform\WebformInterface $webform: The webform to check field definition access.
array $definitions: Field definitions.
Return value
array Field definitions with access checked.
Overrides WebformSubmissionStorageInterface::checkFieldDefinitionAccess
File
- src/
WebformSubmissionStorage.php, line 144
Class
- WebformSubmissionStorage
- Defines the webform submission storage.
Namespace
Drupal\webformCode
public function checkFieldDefinitionAccess(WebformInterface $webform, array $definitions) {
if (!$webform
->access('submission_update_any')) {
unset($definitions['token']);
}
return $definitions;
}