refs #379. Allow_extra_attributes false
parent
8d3c3c195c
commit
e1d782c8a0
|
|
@ -7,6 +7,7 @@ resources:
|
||||||
groups: ['default', 'user:read']
|
groups: ['default', 'user:read']
|
||||||
denormalization_context:
|
denormalization_context:
|
||||||
groups: ['user:write']
|
groups: ['user:write']
|
||||||
|
|
||||||
operations:
|
operations:
|
||||||
ApiPlatform\Metadata\GetCollection:
|
ApiPlatform\Metadata\GetCollection:
|
||||||
provider: App\State\Provider\UserProvider
|
provider: App\State\Provider\UserProvider
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ api_platform:
|
||||||
paths: ['%kernel.project_dir%/config/api_platform', '%kernel.project_dir%/src/Dto']
|
paths: ['%kernel.project_dir%/config/api_platform', '%kernel.project_dir%/src/Dto']
|
||||||
defaults:
|
defaults:
|
||||||
pagination_client_items_per_page: true
|
pagination_client_items_per_page: true
|
||||||
|
denormalization_context:
|
||||||
|
allow_extra_attributes: false
|
||||||
cache_headers:
|
cache_headers:
|
||||||
vary: [ 'Content-Type', 'Authorization', 'Origin' ]
|
vary: [ 'Content-Type', 'Authorization', 'Origin' ]
|
||||||
extra_properties:
|
extra_properties:
|
||||||
|
|
|
||||||
|
|
@ -48,12 +48,12 @@ class UserProcessor implements ProcessorInterface
|
||||||
throw new \Exception(sprintf('data is not instance of %s', UserInput::class));
|
throw new \Exception(sprintf('data is not instance of %s', UserInput::class));
|
||||||
}
|
}
|
||||||
|
|
||||||
$entity = null;
|
$user = null;
|
||||||
if (isset($uriVariables['uuid'])) {
|
if (isset($uriVariables['uuid'])) {
|
||||||
$entity = $this->userRepository->findOneByUuid($uriVariables['uuid']);
|
$user = $this->userRepository->findOneByUuid($uriVariables['uuid']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = $data->createOrUpdateEntity($entity);
|
$user = $data->createOrUpdateEntity($user);
|
||||||
|
|
||||||
if ($data->password !== null){
|
if ($data->password !== null){
|
||||||
$user->setPassword($this->userPasswordHasher->hashPassword($user, $data->password));
|
$user->setPassword($this->userPasswordHasher->hashPassword($user, $data->password));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue