core/modules/rest/src/Plugin/rest/resource/EntityResource.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php index 11791ba..d3ed2f9 100644 --- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php +++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php @@ -287,6 +287,11 @@ public function patch(EntityInterface $original_entity, EntityInterface $entity continue; } } + + if (!$original_entity->get($field_name)->access('edit')) { + throw new AccessDeniedHttpException("Access denied on updating field '$field_name'."); + } + $original_entity->set($field_name, $field->getValue()); } }