| @@ -317,6 +317,9 @@ discard block | ||
| 317 | 317 | return $this->getService()->findAssociationPaginated($entity, $property, $page, $perPage); | 
| 318 | 318 | } | 
| 319 | 319 | |
| 320 | + /** | |
| 321 | + * @return string | |
| 322 | + */ | |
| 320 | 323 | protected function getEntityClass() | 
| 321 | 324 |      { | 
| 322 | 325 |          return $this->getCurrentRequest()->attributes->get('_entityClass'); | 
| @@ -327,6 +330,9 @@ discard block | ||
| 327 | 330 | return Inflector::tableize($this->getClassMetadata()->reflection->getShortName()); | 
| 328 | 331 | } | 
| 329 | 332 | |
| 333 | + /** | |
| 334 | + * @return string | |
| 335 | + */ | |
| 330 | 336 | protected function getServiceId() | 
| 331 | 337 |      { | 
| 332 | 338 |          return $this->getCurrentRequest()->attributes->get('_service'); | 
| @@ -377,6 +383,9 @@ discard block | ||
| 377 | 383 | } | 
| 378 | 384 | } | 
| 379 | 385 | |
| 386 | + /** | |
| 387 | + * @param string|null $subresource | |
| 388 | + */ | |
| 380 | 389 | protected function assertSubresourceListGranted($entity, $subresource) | 
| 381 | 390 |      { | 
| 382 | 391 | $classMetadata = $this->getClassMetadata(); | 
| @@ -391,6 +400,9 @@ discard block | ||
| 391 | 400 | $this->assertRightGranted($entity, $right); | 
| 392 | 401 | } | 
| 393 | 402 | |
| 403 | + /** | |
| 404 | + * @param string|null $subresource | |
| 405 | + */ | |
| 394 | 406 | protected function assertSubresourcePostGranted($entity, $subresource) | 
| 395 | 407 |      { | 
| 396 | 408 | $classMetadata = $this->getClassMetadata(); | 
| @@ -405,6 +417,9 @@ discard block | ||
| 405 | 417 | $this->assertRightGranted($entity, $right); | 
| 406 | 418 | } | 
| 407 | 419 | |
| 420 | + /** | |
| 421 | + * @param string|null $subresource | |
| 422 | + */ | |
| 408 | 423 | protected function assertSubresourcePutGranted($entity, $subresource) | 
| 409 | 424 |      { | 
| 410 | 425 | $classMetadata = $this->getClassMetadata(); | 
| @@ -416,6 +431,9 @@ discard block | ||
| 416 | 431 | } | 
| 417 | 432 | } | 
| 418 | 433 | |
| 434 | + /** | |
| 435 | + * @param string|null $subresource | |
| 436 | + */ | |
| 419 | 437 | protected function assertSubresourceDeleteGranted($entity, $subresource) | 
| 420 | 438 |      { | 
| 421 | 439 | $classMetadata = $this->getClassMetadata(); | 
| @@ -439,6 +457,9 @@ discard block | ||
| 439 | 457 | return $classMetaData; | 
| 440 | 458 | } | 
| 441 | 459 | |
| 460 | + /** | |
| 461 | + * @param string|null $subresource | |
| 462 | + */ | |
| 442 | 463 | protected function getSubResourceEntityClass($subresource) | 
| 443 | 464 |      { | 
| 444 | 465 | /** @var PropertyMetadata $propertyMetadata */ | 
| @@ -447,6 +468,9 @@ discard block | ||
| 447 | 468 | return $propertyMetadata->getType(); | 
| 448 | 469 | } | 
| 449 | 470 | |
| 471 | + /** | |
| 472 | + * @param string $propertyPath | |
| 473 | + */ | |
| 450 | 474 | protected function resolveSubject($entity, $propertyPath) | 
| 451 | 475 |      { | 
| 452 | 476 |          if ('this' === $propertyPath) { | 
| @@ -536,6 +560,9 @@ discard block | ||
| 536 | 560 | ); | 
| 537 | 561 | } | 
| 538 | 562 | |
| 563 | + /** | |
| 564 | + * @param string[] $attributes | |
| 565 | + */ | |
| 539 | 566 | protected function denyAccessUnlessGranted($attributes, $object = null, $message = 'Access Denied.') | 
| 540 | 567 |      { | 
| 541 | 568 |          if (!$this->getAuthorizationChecker()->isGranted($attributes, $object)) { | 
| @@ -168,6 +168,9 @@ discard block | ||
| 168 | 168 | return false; | 
| 169 | 169 | } | 
| 170 | 170 | |
| 171 | + /** | |
| 172 | + * @param Right|null $right | |
| 173 | + */ | |
| 171 | 174 | private function isGranted($object, ?Right $right) | 
| 172 | 175 |      { | 
| 173 | 176 |          if (null === $right) { | 
| @@ -193,6 +196,9 @@ discard block | ||
| 193 | 196 | return $this->propertyAccessor->getValue($entity, $propertyPath); | 
| 194 | 197 | } | 
| 195 | 198 | |
| 199 | + /** | |
| 200 | + * @param string|null $type | |
| 201 | + */ | |
| 196 | 202 | private function convert(?string $type, $value) | 
| 197 | 203 |      { | 
| 198 | 204 |          if (null === $value) { |