Skip to content
Snippets Groups Projects

Read only fields

All threads resolved!
Files
4
@@ -31,9 +31,9 @@ class CustomAccess extends Base implements CustomPermissionsInterface, AdminForm
$field_name = $this->fieldStorage->getName();
if ($operation === 'edit' && $entity->isNew()) {
return $account->hasPermission('create ' . $field_name);
return $account->hasPermission('create ' . $field_name) || $account->hasPermission('create read-only ' . $field_name);
}
if ($account->hasPermission($operation . ' ' . $field_name)) {
if ($account->hasPermission($operation . ' ' . $field_name) || $account->hasPermission($operation . ' read-only ' . $field_name)) {
return TRUE;
}
else {
Loading