stable

Clone or download

Read-only

Refactoring: Extract project administrator check

Part of story #14541 have OAuth2 project admin Project admin has more and more controllers. They should all check that the current user is project administrator the same way. This contribution introduces a dedicated object for that purpose. It also introduces a helper to display Project administration header and footer consistently. No functional change expected in project admin. Change-Id: I56dc1c2b9682994cf1f572490a2f2d16231eff94

Modified Files

Name
M plugins/project_ownership/include/ProjectAdmin/IndexController.php +19 −40 Go to diff View file
M plugins/project_ownership/phpunit/ProjectAdmin/IndexControllerTest.php +26 −25 Go to diff View file
M plugins/project_ownership/site-content/fr_FR/LC_MESSAGES/tuleap-project_ownership.po +0 −3 Go to diff View file
M src/common/Project/Admin/Categories/IndexController.php +40 −26 Go to diff View file
M src/common/Project/Admin/Categories/UpdateController.php +17 −11 Go to diff View file
A src/common/Project/Admin/Navigation/FooterDisplayer.php +31 −0 Go to diff View file
M src/common/Project/Admin/ProjectMembers/ProjectMembersController.php +20 −6 Go to diff View file
M src/common/Project/Admin/ProjectUGroup/MemberAdditionController.php +21 −10 Go to diff View file
M src/common/Project/Admin/ProjectUGroup/MemberRemovalController.php +9 −3 Go to diff View file
M src/common/Project/Admin/ProjectUGroup/SynchronizedProjectMembership/ActivationController.php +10 −3 Go to diff View file
A src/common/Project/Admin/Routing/AdministrationLayoutHelper.php +82 −0 Go to diff View file
A src/common/Project/Admin/Routing/LayoutHelper.php +39 −0 Go to diff View file
A src/common/Project/Admin/Routing/ProjectAdministratorChecker.php +42 −0 Go to diff View file
M src/common/Project/Banner/BannerAdministrationController.php +26 −41 Go to diff View file
M src/common/Project/Service/AddController.php +23 −14 Go to diff View file
M src/common/Project/Service/DeleteController.php +19 −14 Go to diff View file
M src/common/Project/Service/EditController.php +24 −14 Go to diff View file
M src/common/Project/Service/IndexController.php +41 −53 Go to diff View file
A tests/lib/Helpers/LayoutHelperPassthrough.php +49 −0 Go to diff View file
M tests/phpunit/common/Project/Admin/Categories/IndexControllerTest.php +50 −17 Go to diff View file
M tests/phpunit/common/Project/Admin/Categories/UpdateControllerTest.php +18 −23 Go to diff View file
M tests/phpunit/common/Project/Admin/ProjectMembers/ProjectMembersControllerTest.php +46 −13 Go to diff View file
M tests/phpunit/common/Project/Admin/ProjectUGroup/MemberAdditionControllerTest.php +22 −12 Go to diff View file
M tests/phpunit/common/Project/Admin/ProjectUGroup/MemberRemovalControllerTest.php +23 −14 Go to diff View file
M tests/phpunit/common/Project/Admin/ProjectUGroup/SynchronizedProjectMembership/ActivationControllerTest.php +26 −1 Go to diff View file
A tests/phpunit/common/Project/Admin/Routing/AdministrationLayoutHelperTest.php +99 −0 Go to diff View file
A tests/phpunit/common/Project/Admin/Routing/ProjectAdministratorCheckerTest.php +73 −0 Go to diff View file
M tests/phpunit/common/Project/Banner/BannerAdministrationControllerTest.php +42 −38 Go to diff View file
M tests/phpunit/common/Project/Service/AddControllerTest.php +30 −14 Go to diff View file
M tests/phpunit/common/Project/Service/DeleteControllerTest.php +25 −53 Go to diff View file
M tests/phpunit/common/Project/Service/EditControllerTest.php +29 −14 Go to diff View file
M tests/phpunit/common/Project/Service/IndexControllerTest.php +67 −26 Go to diff View file