stable

Clone or download

Read-only

fix: agiledashboard import during archive import

Since git #tuleap/stable/d1f996d6e16f9bbc68a8a6328549ff723ed1e0b0 if the import contains the structure of a backlog, the import from an archive fails. This is due to the fact that during the import of the plannings, we check that current user can access the trackers. But since the aforementionned commit, the project that is being imported is marked as X, and therefore is not accessible. In order to solve this situation, we now bypass the permission check in this very situation. The analysis of the flow can be summarized by the following [flowchart][0]: ```mermaid flowchart TD B[planningTrackerIdIsValid] --> A[Tracker::userCanView] C[backlogTrackerIdsArePresentAndAreValid] --> A D[Planning_RequestValidator::isValid] --> B D --> C E[Planning_Controller::create] --> D F[AgileDashboard_XMLController::importPlannings] --> D G[importProject] --> F H[importOnlyAgileDashboard] --> F I[action=create #WEB] --> E J[action=import #WEB] --> H K[action=import #CLI]:::focus --> G:::focus classDef focus fill:#c42887,stroke:#ffffff,color:#ffffff ``` No functional changes in other cases than archive import. Part of story #36484 create a new project from an XML template [0]: https://mermaid.live/view#pako:eNpdkl1rwjAUhv9Kibf1ZgwmgQ209aObY7LJNmhFjumpZqaJS1JExP--2FSsy1XevM97Tr6OhKkcCSWFUHu2AW2DeZzJwI1BuhMgJZfruQa2RZ3kifkEwfNF0O0-Bf20Wae0MqgjkJ8c9wsfjtKV84S6Zk1f40yjQWn7MneiXcqH4nTWdFy-42-FxtYMWOV68HbvQROoReTF8JqOlLRaCXHeG9MIFn2sOdko7a-5wBjMZqVA58vv12k7wsud0vZSzdxkx2njavWDzHpv5L1J471JcbjtcIMlKTDLlXz0Wws6X8OBB4YeeL4AvlwLmHjg5T8QTZMFpbRQrDI1OL6oTPoIE2BMjEXgmYILQTvs_q7XewiNO_kWaaeoR8iUcBfeKBKSEnUJPHef5HiulRG7wRIzQt00xwIqYTOSyZNDobLq4yAZoVZXGJJq514PYw5rDaVfPP0BEyPPkw Change-Id: Ic8f5ac3873747d3b61b77ed434b2dc5efc94e909

Modified Files

Name
M plugins/agiledashboard/include/AgileDashboard/AgileDashboardXMLController.class.php +10 −5 Go to diff View file
A plugins/agiledashboard/include/AgileDashboard/Planning/BypassTrackerPermissionDuringImport.php +31 −0 Go to diff View file
A plugins/agiledashboard/include/AgileDashboard/Planning/EnsureThatTrackerIsReadableByUser.php +31 −0 Go to diff View file
A plugins/agiledashboard/include/AgileDashboard/Planning/VerifyTrackerAccessDuringImportStrategy.php +26 −0 Go to diff View file
M plugins/agiledashboard/include/Planning/PlanningController.class.php +2 −1 Go to diff View file
M plugins/agiledashboard/include/Planning/PlanningRequestValidator.class.php +48 −13 Go to diff View file
A plugins/agiledashboard/tests/unit/AgileDashboard/Planning/BypassTrackerPermissionDuringImportTest.php +44 −0 Go to diff View file
A plugins/agiledashboard/tests/unit/AgileDashboard/Planning/EnsureThatTrackerIsReadableByUserTest.php +44 −0 Go to diff View file
M plugins/agiledashboard/tests/unit/Planning/Planning_RequestValidatorTest.php +54 −8 Go to diff View file