@@ -310,6 +310,9 @@ discard block |
||
| 310 | 310 | return $this->getService()->findAssociationPaginated($entity, $property, $page, $perPage); |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | + /** |
|
| 314 | + * @return string |
|
| 315 | + */ |
|
| 313 | 316 | protected function getEntityClass() |
| 314 | 317 | { |
| 315 | 318 | return $this->getCurrentRequest()->attributes->get('_entityClass'); |
@@ -320,6 +323,9 @@ discard block |
||
| 320 | 323 | return Inflector::tableize($this->getClassMetadata()->reflection->getShortName()); |
| 321 | 324 | } |
| 322 | 325 | |
| 326 | + /** |
|
| 327 | + * @return string |
|
| 328 | + */ |
|
| 323 | 329 | protected function getServiceId() |
| 324 | 330 | { |
| 325 | 331 | return $this->getCurrentRequest()->attributes->get('_service'); |
@@ -370,6 +376,9 @@ discard block |
||
| 370 | 376 | } |
| 371 | 377 | } |
| 372 | 378 | |
| 379 | + /** |
|
| 380 | + * @param string $subresource |
|
| 381 | + */ |
|
| 373 | 382 | protected function assertSubresourceListGranted($entity, $subresource) |
| 374 | 383 | { |
| 375 | 384 | $classMetadata = $this->getClassMetadata(); |
@@ -384,6 +393,9 @@ discard block |
||
| 384 | 393 | $this->assertRightGranted($entity, $right); |
| 385 | 394 | } |
| 386 | 395 | |
| 396 | + /** |
|
| 397 | + * @param string $subresource |
|
| 398 | + */ |
|
| 387 | 399 | protected function assertSubresourcePostGranted($entity, $subresource) |
| 388 | 400 | { |
| 389 | 401 | $classMetadata = $this->getClassMetadata(); |
@@ -398,6 +410,9 @@ discard block |
||
| 398 | 410 | $this->assertRightGranted($entity, $right); |
| 399 | 411 | } |
| 400 | 412 | |
| 413 | + /** |
|
| 414 | + * @param string $subresource |
|
| 415 | + */ |
|
| 401 | 416 | protected function assertSubresourcePutGranted($entity, $subresource) |
| 402 | 417 | { |
| 403 | 418 | $classMetadata = $this->getClassMetadata(); |
@@ -409,6 +424,9 @@ discard block |
||
| 409 | 424 | } |
| 410 | 425 | } |
| 411 | 426 | |
| 427 | + /** |
|
| 428 | + * @param string $subresource |
|
| 429 | + */ |
|
| 412 | 430 | protected function assertSubresourceDeleteGranted($entity, $subresource) |
| 413 | 431 | { |
| 414 | 432 | $classMetadata = $this->getClassMetadata(); |
@@ -432,6 +450,9 @@ discard block |
||
| 432 | 450 | return $classMetaData; |
| 433 | 451 | } |
| 434 | 452 | |
| 453 | + /** |
|
| 454 | + * @param string $subresource |
|
| 455 | + */ |
|
| 435 | 456 | protected function getSubResourceEntityClass($subresource) |
| 436 | 457 | { |
| 437 | 458 | /** @var PropertyMetadata $propertyMetadata */ |
@@ -440,6 +461,9 @@ discard block |
||
| 440 | 461 | return $propertyMetadata->getType(); |
| 441 | 462 | } |
| 442 | 463 | |
| 464 | + /** |
|
| 465 | + * @param string $propertyPath |
|
| 466 | + */ |
|
| 443 | 467 | protected function resolveSubject($entity, $propertyPath) |
| 444 | 468 | { |
| 445 | 469 | if ('this' === $propertyPath) { |
@@ -529,6 +553,9 @@ discard block |
||
| 529 | 553 | ); |
| 530 | 554 | } |
| 531 | 555 | |
| 556 | + /** |
|
| 557 | + * @param string[] $attributes |
|
| 558 | + */ |
|
| 532 | 559 | protected function denyAccessUnlessGranted($attributes, $object = null, $message = 'Access Denied.') |
| 533 | 560 | { |
| 534 | 561 | if (!$this->getAuthorizationChecker()->isGranted($attributes, $object)) { |