diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php index f875541..693ceb5 100644 --- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php +++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php @@ -149,7 +149,7 @@ public function post(EntityInterface $entity = NULL) { throw new BadRequestHttpException('Only new entities can be created'); } - $this->checkCreateFieldAccess($entity); + $this->checkEditFieldAccess($entity); // Validate the received data before saving. $this->validate($entity); diff --git a/core/modules/rest/src/Plugin/rest/resource/UserRegistrationResource.php b/core/modules/rest/src/Plugin/rest/resource/UserRegistrationResource.php index 58db948..01846bb 100644 --- a/core/modules/rest/src/Plugin/rest/resource/UserRegistrationResource.php +++ b/core/modules/rest/src/Plugin/rest/resource/UserRegistrationResource.php @@ -125,7 +125,7 @@ public function post(UserInterface $account = NULL) { $account->block(); } - $this->checkCreateFieldAccess($account); + $this->checkEditFieldAccess($account); // Make sure that the user entity is valid (email and name are valid). $this->validate($account);