Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php |
||
24 | class PermissionResolverTest extends BaseTest |
||
25 | { |
||
26 | /** |
||
27 | * Test for the getCurrentUser() method. |
||
28 | * |
||
29 | * @see \eZ\Publish\API\Repository\PermissionResolver::getCurrentUserReference() |
||
30 | */ |
||
31 | public function testGetCurrentUserReferenceReturnsAnonymousUserReference() |
||
57 | |||
58 | /** |
||
59 | * Test for the setCurrentUser() method. |
||
60 | * |
||
61 | * @see \eZ\Publish\API\Repository\PermissionResolver::setCurrentUserReference() |
||
62 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
63 | */ |
||
64 | View Code Duplication | public function testSetCurrentUserReference() |
|
99 | |||
100 | /** |
||
101 | * Test for the hasAccess() method. |
||
102 | * |
||
103 | * @see \eZ\Publish\API\Repository\PermissionResolver::hasAccess() |
||
104 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
105 | */ |
||
106 | public function testHasAccessWithAnonymousUserNo() |
||
129 | |||
130 | /** |
||
131 | * Test for the hasAccess() method. |
||
132 | * |
||
133 | * @see \eZ\Publish\API\Repository\PermissionResolver::hasAccess() |
||
134 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
135 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessWithAnonymousUserNo |
||
136 | */ |
||
137 | View Code Duplication | public function testHasAccessForCurrentUserNo() |
|
163 | |||
164 | /** |
||
165 | * Test for the hasAccess() method. |
||
166 | * |
||
167 | * @see \eZ\Publish\API\Repository\PermissionResolver::hasAccess() |
||
168 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
169 | */ |
||
170 | public function testHasAccessWithAdministratorUser() |
||
191 | |||
192 | /** |
||
193 | * Test for the hasAccess() method. |
||
194 | * |
||
195 | * @see \eZ\Publish\API\Repository\PermissionResolver::hasAccess() |
||
196 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
197 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testSetCurrentUserReference |
||
198 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessWithAdministratorUser |
||
199 | */ |
||
200 | View Code Duplication | public function testHasAccessForCurrentUserYes() |
|
224 | |||
225 | /** |
||
226 | * Test for the hasAccess() method. |
||
227 | * |
||
228 | * @see \eZ\Publish\API\Repository\PermissionResolver::hasAccess() |
||
229 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
230 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testSetCurrentUserReference |
||
231 | */ |
||
232 | View Code Duplication | public function testHasAccessLimited() |
|
255 | |||
256 | /** |
||
257 | * Test for the canUser() method. |
||
258 | * |
||
259 | * @see \eZ\Publish\API\Repository\PermissionResolver::canUser() |
||
260 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
261 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
262 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessForCurrentUserNo |
||
263 | * @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
||
264 | */ |
||
265 | public function testCanUserForAnonymousUserNo() |
||
300 | |||
301 | /** |
||
302 | * Test for the canUser() method. |
||
303 | * |
||
304 | * @see \eZ\Publish\API\Repository\PermissionResolver::canUser() |
||
305 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
306 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
307 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessForCurrentUserYes |
||
308 | * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
||
309 | */ |
||
310 | public function testCanUserForAdministratorUser() |
||
311 | { |
||
312 | $repository = $this->getRepository(); |
||
313 | |||
314 | $administratorUserId = $this->generateId('user', 14); |
||
315 | $homeId = $this->generateId('object', 57); |
||
316 | |||
317 | /* BEGIN: Use Case */ |
||
318 | // $administratorUserId contains the ID of the administrator user |
||
319 | // $homeId contains the ID of the "Home" frontpage |
||
320 | |||
321 | $contentService = $repository->getContentService(); |
||
322 | $userService = $repository->getUserService(); |
||
323 | $permissionResolver = $repository->getPermissionResolver(); |
||
324 | |||
325 | // Load administrator user |
||
326 | $administratorUser = $userService->loadUser($administratorUserId); |
||
327 | |||
328 | // Set administrator user as current user reference |
||
329 | $permissionResolver->setCurrentUserReference($administratorUser); |
||
330 | |||
331 | // Load the ContentInfo for "Home" frontpage |
||
332 | $contentInfo = $contentService->loadContentInfo($homeId); |
||
333 | |||
334 | // This call will return true |
||
335 | $canUser = $permissionResolver->canUser('content', 'remove', $contentInfo); |
||
336 | |||
337 | // Performing an action having necessary permissions will succeed |
||
338 | $contentService->deleteContent($contentInfo); |
||
339 | /* END: Use Case */ |
||
340 | |||
341 | $this->assertTrue($canUser); |
||
342 | $contentService->loadContent($homeId); |
||
343 | } |
||
344 | |||
345 | /** |
||
346 | * Test for the canUser() method. |
||
347 | * |
||
348 | * @see \eZ\Publish\API\Repository\PermissionResolver::canUser() |
||
349 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
350 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
351 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessLimited |
||
352 | */ |
||
353 | View Code Duplication | public function testCanUserWithLimitationYes() |
|
380 | |||
381 | /** |
||
382 | * Test for the canUser() method. |
||
383 | * |
||
384 | * @see \eZ\Publish\API\Repository\PermissionResolver::canUser() |
||
385 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
386 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
387 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessLimited |
||
388 | * @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
||
389 | */ |
||
390 | public function testCanUserWithLimitationNo() |
||
423 | |||
424 | /** |
||
425 | * Test for the canUser() method. |
||
426 | * |
||
427 | * @see \eZ\Publish\API\Repository\PermissionResolver::canUser() |
||
428 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
429 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentTypeService |
||
430 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testSetCurrentUserReference |
||
431 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessLimited |
||
432 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
433 | */ |
||
434 | public function testCanUserThrowsInvalidArgumentException() |
||
435 | { |
||
436 | $repository = $this->getRepository(); |
||
437 | |||
438 | $userGroupContentTypeId = $this->generateId('type', 3); |
||
439 | |||
440 | /* BEGIN: Use Case */ |
||
441 | // $userGroupContentTypeId contains the ID of the "UserGroup" ContentType |
||
442 | |||
443 | $user = $this->createUserVersion1(); |
||
444 | |||
445 | $permissionResolver = $repository->getPermissionResolver(); |
||
446 | |||
447 | // Set created user as current user reference |
||
448 | $permissionResolver->setCurrentUserReference($user); |
||
449 | |||
450 | $contentTypeService = $repository->getContentTypeService(); |
||
451 | |||
452 | // Load the "UserGroup" ContentType |
||
453 | $userGroupContentType = $contentTypeService->loadContentType($userGroupContentTypeId); |
||
454 | |||
455 | // This call will throw "InvalidArgumentException" because $userGroupContentType |
||
456 | // is an instance of \eZ\Publish\API\Repository\Values\ContentType\ContentType, |
||
457 | // which can not be checked for user access |
||
458 | $canUser = $permissionResolver->canUser('content', 'create', $userGroupContentType); |
||
459 | /* END: Use Case */ |
||
460 | } |
||
461 | |||
462 | /** |
||
463 | * Test for the canUser() method. |
||
464 | * |
||
465 | * @see \eZ\Publish\API\Repository\PermissionResolver::canUser() |
||
466 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
467 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
468 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentTypeService |
||
469 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessLimited |
||
470 | */ |
||
471 | View Code Duplication | public function testCanUserWithTargetYes() |
|
522 | |||
523 | /** |
||
524 | * Test for the canUser() method. |
||
525 | * |
||
526 | * @see \eZ\Publish\API\Repository\PermissionResolver::canUser() |
||
527 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
528 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
529 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentTypeService |
||
530 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessLimited |
||
531 | * @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
||
532 | */ |
||
533 | public function testCanUserWithTargetNo() |
||
534 | { |
||
535 | $repository = $this->getRepository(); |
||
536 | |||
537 | $homeLocationId = $this->generateId('location', 2); |
||
538 | |||
539 | /* BEGIN: Use Case */ |
||
540 | // $homeLocationId contains the ID of the "Home" frontpage location |
||
541 | |||
542 | $user = $this->createUserVersion1(); |
||
543 | |||
544 | $permissionResolver = $repository->getPermissionResolver(); |
||
545 | |||
546 | // Set created user as current user reference |
||
547 | $permissionResolver->setCurrentUserReference($user); |
||
548 | |||
549 | $contentTypeService = $repository->getContentTypeService(); |
||
550 | |||
551 | $contentType = $contentTypeService->loadContentTypeByIdentifier('forum'); |
||
552 | |||
553 | $contentService = $repository->getContentService(); |
||
554 | |||
555 | $contentCreateStruct = $contentService->newContentCreateStruct($contentType, 'eng-US'); |
||
556 | $contentCreateStruct->setField('name', 'My awesome forum'); |
||
557 | $contentCreateStruct->remoteId = 'abcdef0123456789abcdef0123456789'; |
||
558 | $contentCreateStruct->alwaysAvailable = true; |
||
559 | |||
560 | $locationService = $repository->getLocationService(); |
||
561 | $locationCreateStruct = $locationService->newLocationCreateStruct($homeLocationId); |
||
562 | |||
563 | // This call will return false because user with Editor role has permission to |
||
564 | // create "forum" type content only under "folder" type content. |
||
565 | $canUser = $permissionResolver->canUser( |
||
566 | 'content', |
||
567 | 'create', |
||
568 | $contentCreateStruct, |
||
569 | [$locationCreateStruct] |
||
570 | ); |
||
571 | |||
572 | // Performing an action without necessary permissions will fail with "UnauthorizedException" |
||
573 | if (!$canUser) { |
||
574 | $contentDraft = $contentService->createContent( |
||
575 | $contentCreateStruct, |
||
576 | [$locationCreateStruct] |
||
577 | ); |
||
578 | } |
||
579 | /* END: Use Case */ |
||
580 | } |
||
581 | |||
582 | /** |
||
583 | * Test for the canUser() method. |
||
584 | * |
||
585 | * @see \eZ\Publish\API\Repository\PermissionResolver::canUser() |
||
586 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
587 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
588 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentTypeService |
||
589 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessLimited |
||
590 | */ |
||
591 | View Code Duplication | public function testCanUserWithMultipleTargetsYes() |
|
643 | |||
644 | /** |
||
645 | * Test for the canUser() method. |
||
646 | * |
||
647 | * @see \eZ\Publish\API\Repository\PermissionResolver::canUser() |
||
648 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
649 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
650 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentTypeService |
||
651 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessLimited |
||
652 | * @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
||
653 | */ |
||
654 | public function testCanUserWithMultipleTargetsNo() |
||
655 | { |
||
656 | $repository = $this->getRepository(); |
||
657 | |||
658 | $homeLocationId = $this->generateId('location', 2); |
||
659 | $administratorUsersLocationId = $this->generateId('location', 13); |
||
660 | |||
661 | /* BEGIN: Use Case */ |
||
662 | // $homeLocationId contains the ID of the "Home" location |
||
663 | // $administratorUsersLocationId contains the ID of the "Administrator users" location |
||
664 | |||
665 | $user = $this->createUserVersion1(); |
||
666 | |||
667 | $permissionResolver = $repository->getPermissionResolver(); |
||
668 | |||
669 | // Set created user as current user reference |
||
670 | $permissionResolver->setCurrentUserReference($user); |
||
671 | |||
672 | $contentTypeService = $repository->getContentTypeService(); |
||
673 | |||
674 | $contentType = $contentTypeService->loadContentTypeByIdentifier('forums'); |
||
675 | |||
676 | $contentService = $repository->getContentService(); |
||
677 | |||
678 | $contentCreateStruct = $contentService->newContentCreateStruct($contentType, 'eng-US'); |
||
679 | $contentCreateStruct->setField('name', 'My awesome forums'); |
||
680 | $contentCreateStruct->remoteId = 'abcdef0123456789abcdef0123456789'; |
||
681 | $contentCreateStruct->alwaysAvailable = true; |
||
682 | |||
683 | $locationService = $repository->getLocationService(); |
||
684 | $locationCreateStruct1 = $locationService->newLocationCreateStruct($homeLocationId); |
||
685 | $locationCreateStruct2 = $locationService->newLocationCreateStruct($administratorUsersLocationId); |
||
686 | $locationCreateStructs = [$locationCreateStruct1, $locationCreateStruct2]; |
||
687 | |||
688 | // This call will return false because user with Editor role does not have permission to |
||
689 | // create content in the "Administrator users" location subtree |
||
690 | $canUser = $permissionResolver->canUser( |
||
691 | 'content', |
||
692 | 'create', |
||
693 | $contentCreateStruct, |
||
694 | $locationCreateStructs |
||
695 | ); |
||
696 | |||
697 | // Performing an action without necessary permissions will fail with "UnauthorizedException" |
||
698 | if (!$canUser) { |
||
699 | $contentDraft = $contentService->createContent($contentCreateStruct, $locationCreateStructs); |
||
700 | } |
||
701 | /* END: Use Case */ |
||
702 | } |
||
703 | |||
704 | /** |
||
705 | * Test for the canUser() method. |
||
706 | * |
||
707 | * @see \eZ\Publish\API\Repository\PermissionResolver::canUser() |
||
708 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
709 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
710 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentTypeService |
||
711 | * @depends eZ\Publish\API\Repository\Tests\RepositoryTest::testGetURLAliasService |
||
712 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testSetCurrentUserReference |
||
713 | * @depends eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessLimited |
||
714 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
715 | */ |
||
716 | View Code Duplication | public function testCanUserWithTargetThrowsInvalidArgumentException() |
|
751 | |||
752 | /** |
||
753 | * Test for the canUser() method. |
||
754 | * |
||
755 | * @see \eZ\Publish\API\Repository\PermissionResolver::canUser() |
||
756 | * @expectedException \eZ\Publish\API\Repository\Exceptions\BadStateException |
||
757 | */ |
||
758 | public function testCanUserThrowsBadStateException() |
||
764 | |||
765 | /** |
||
766 | * Test PermissionResolver::canUser for Users with different Limitations. |
||
767 | * |
||
768 | * @covers \eZ\Publish\API\Repository\PermissionResolver::canUser |
||
769 | * |
||
770 | * @dataProvider getDataForTestCanUserWithLimitations |
||
771 | * |
||
772 | * @param \eZ\Publish\API\Repository\Values\User\Limitation $limitation |
||
773 | * @param string $module |
||
774 | * @param string $function |
||
775 | * @param \eZ\Publish\API\Repository\Values\ValueObject $object |
||
776 | * @param array $targets |
||
777 | * @param bool $expectedResult expected result of canUser check |
||
778 | * |
||
779 | * @throws \eZ\Publish\API\Repository\Exceptions\BadStateException |
||
780 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
781 | */ |
||
782 | public function testCanUserWithLimitations( |
||
813 | |||
814 | /** |
||
815 | * Data provider for testCanUserWithLimitations. |
||
816 | * @see testCanUserWithLimitations |
||
817 | * |
||
818 | * @return array |
||
819 | * |
||
820 | * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException |
||
821 | */ |
||
822 | public function getDataForTestCanUserWithLimitations() |
||
869 | |||
870 | /** |
||
871 | * Test for the lookupLimitations() method. |
||
872 | * |
||
873 | * @see \eZ\Publish\API\Repository\PermissionResolver::lookupLimitations() |
||
874 | * @depends \eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
875 | * @depends \eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
876 | * @depends \eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessForCurrentUserNo |
||
877 | */ |
||
878 | View Code Duplication | public function testLookupLimitationsForAnonymousUserHasNoAccess(): void |
|
913 | |||
914 | /** |
||
915 | * Test for the lookupLimitations() method. |
||
916 | * |
||
917 | * @see \eZ\Publish\API\Repository\PermissionResolver::lookupLimitations() |
||
918 | * @depends \eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
919 | * @depends \eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
920 | * @depends \eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessForCurrentUserYes |
||
921 | */ |
||
922 | View Code Duplication | public function testLookupLimitationsForAdministratorUser(): void |
|
954 | |||
955 | /** |
||
956 | * When one of policy pass then all limitation should be returned. |
||
957 | * |
||
958 | * @see \eZ\Publish\API\Repository\PermissionResolver::lookupLimitations() |
||
959 | * @depends \eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
960 | * @depends \eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
961 | * @depends \eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessForCurrentUserYes |
||
962 | * |
||
963 | * @throws \eZ\Publish\API\Repository\Exceptions\BadStateException |
||
964 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
965 | * @throws \eZ\Publish\API\Repository\Exceptions\LimitationValidationException |
||
966 | * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException |
||
967 | * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
||
968 | */ |
||
969 | public function testLookupLimitationsWithLimitations(): void |
||
1015 | |||
1016 | /** |
||
1017 | * When one of policy pass then only filtered limitation should be returned. |
||
1018 | * |
||
1019 | * @see \eZ\Publish\API\Repository\PermissionResolver::lookupLimitations() |
||
1020 | * @depends \eZ\Publish\API\Repository\Tests\RepositoryTest::testGetUserService |
||
1021 | * @depends \eZ\Publish\API\Repository\Tests\RepositoryTest::testGetContentService |
||
1022 | * @depends \eZ\Publish\API\Repository\Tests\PermissionResolverTest::testHasAccessForCurrentUserYes |
||
1023 | * |
||
1024 | * @throws \eZ\Publish\API\Repository\Exceptions\BadStateException |
||
1025 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
1026 | * @throws \eZ\Publish\API\Repository\Exceptions\LimitationValidationException |
||
1027 | * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException |
||
1028 | * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
||
1029 | */ |
||
1030 | public function testLookupLimitationsWithFilteredLimitations(): void |
||
1075 | |||
1076 | /** |
||
1077 | * If the role limitation is set it should be taken into account. In this case, role limitation |
||
1078 | * will pass and ContentTypeLimitation should be returned. |
||
1079 | * |
||
1080 | * @throws \eZ\Publish\API\Repository\Exceptions\BadStateException |
||
1081 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
1082 | * @throws \eZ\Publish\API\Repository\Exceptions\LimitationValidationException |
||
1083 | * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException |
||
1084 | * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
||
1085 | */ |
||
1086 | public function testLookupLimitationsWithRoleLimitationsHasAccess(): void |
||
1129 | |||
1130 | /** |
||
1131 | * If the role limitation is set and policy limitation is not set it should be taken into account. |
||
1132 | * In this case, role limitation will pass and SectionLimitation should be returned as role limitation |
||
1133 | * and limitations in LookupPolicyLimitations should be an empty array. |
||
1134 | * |
||
1135 | * @see https://jira.ez.no/browse/EZP-30728 |
||
1136 | * |
||
1137 | * @throws \eZ\Publish\API\Repository\Exceptions\BadStateException |
||
1138 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
1139 | * @throws \eZ\Publish\API\Repository\Exceptions\LimitationValidationException |
||
1140 | * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException |
||
1141 | * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
||
1142 | */ |
||
1143 | public function testLookupLimitationsWithRoleLimitationsWithoutPolicyLimitationsHasAccess(): void |
||
1185 | |||
1186 | /** |
||
1187 | * If the role limitation is set it should be taken into account. In this case, role limitation |
||
1188 | * will not pass and ContentTypeLimitation should not be returned. |
||
1189 | * |
||
1190 | * @throws \eZ\Publish\API\Repository\Exceptions\BadStateException |
||
1191 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
1192 | * @throws \eZ\Publish\API\Repository\Exceptions\LimitationValidationException |
||
1193 | * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException |
||
1194 | * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
||
1195 | */ |
||
1196 | public function testLookupLimitationsWithRoleLimitationsHasNoAccess(): void |
||
1234 | |||
1235 | /** |
||
1236 | * @param \eZ\Publish\API\Repository\Repository $repository |
||
1237 | * @param string $contentTypeIdentifier |
||
1238 | * @param string $mainLanguageCode |
||
1239 | * @param int $sectionId |
||
1240 | * |
||
1241 | * @return \eZ\Publish\API\Repository\Values\Content\ContentCreateStruct |
||
1242 | * |
||
1243 | * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException |
||
1244 | */ |
||
1245 | private function getContentCreateStruct( |
||
1259 | } |
||
1260 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.