stable
Clone or download
Part of epic #12142 Baseline v1 Objective: check authorizations as soon as possible. Some authorizations are verified when entering in domain (with domain services). Indeed, domain services are exposed through REST api, but other interfaces may be possible. So REST interface is not a good candidate for authorizations checks. Other authorizations are verified in adapters when check cannot be done earlier. Ex: with findById, we have to query database to known which project is involved. It is only once you have the instance, that you know the project. For maintenance reasons, a single component is responsible for all domain authorization rules: BaselineAuthorizations. Note: this change is only about authorizations on baseline resource. Authorizations on comparions are out of scope for now. Change-Id: I568aa533db5f5eb79dac1564a50a96f6c6a92541
Modified Files
Name | ||||
---|---|---|---|---|
M | include/Adapter/AdapterPermissions.php | +3 | −29 | Go to diff View file |
M | include/Adapter/BaselineArtifactRepositoryAdapter.php | +2 | −7 | Go to diff View file |
M | include/Adapter/BaselineRepositoryAdapter.php | +12 | −33 | Go to diff View file |
M | include/Adapter/ProjectRepositoryAdapter.php | +11 | −7 | Go to diff View file |
R | include/Adapter/RoleAssignmentRepository.php | Go to diff View file | ||
A | include/Domain/BaselineAuthorizations.php | +38 | −0 | Go to diff View file |
A | include/Domain/BaselineAuthorizationsImpl.php | +94 | −0 | Go to diff View file |
M | include/Domain/BaselineService.php | +24 | −5 | Go to diff View file |
A | include/Domain/RoleAssignmentRepository.php | +35 | −0 | Go to diff View file |
M | include/REST/BaselineController.php | +5 | −10 | Go to diff View file |
M | include/REST/BaselinesResource.php | +1 | −1 | Go to diff View file |
M | include/REST/ProjectBaselinesResource.php | +2 | −0 | Go to diff View file |
M | include/Support/ContainerBuilderFactory.php | +6 | −0 | Go to diff View file |
M | phpunit/Adapter/BaselineArtifactRepositoryAdapterTest.php | +2 | −19 | Go to diff View file |
M | phpunit/Adapter/BaselineRepositoryAdapterTest.php | +11 | −20 | Go to diff View file |
M | phpunit/Domain/BaselineServiceTest.php | +82 | −13 | Go to diff View file |
M | phpunit/REST/BaselineControllerTest.php | +0 | −11 | Go to diff View file |
M | phpunit/REST/IntegrationTestCaseWithStubs.php | +3 | −0 | Go to diff View file |
A | phpunit/Stub/FullAccessBaselineAuthorizationsStub.php | +54 | −0 | Go to diff View file |
M | site-content/fr_FR/LC_MESSAGES/tuleap-baseline.po | +8 | −11 | Go to diff View file |