- Issue created by @vlooi vlerke
- Status changed to Needs review
about 1 year ago 9:28am 13 October 2023 - πΏπ¦South Africa vlooi vlerke
It turns out a permission setting was missing.
Add the following to expense_tracker.permissions.yml
administer expense_tracker: title: 'Administer expense and income data'
A new permission will be available to select and this will give you access to set the author.
The code this permission executes is in place at src/EtTransactionAccessControlHandler.php
/** * {@inheritdoc} */ protected function checkFieldAccess($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) { $restricted_fields = [ 'uid', ]; if ($operation === 'edit' && in_array($field_definition->getName(), $restricted_fields, TRUE)) { return AccessResult::allowedIfHasPermission($account, 'administer expense_tracker'); } return parent::checkFieldAccess($operation, $field_definition, $account, $items); } }