stable

Clone or download

Read-only

refactor: remove user_has_special_access from header params

In git #tuleap/stable/92ecfef184b4ec04429c2cad871ffb40a8e2c76c, we introduced a new param for `BaseLayout::header()`: `active-promoted-item-id`. We did it this way because it was the fastest way to deliver the feature. However we should stop relying on an associative array to pass variables to `header()`. Therefore, in order to leave the place cleaner than we found it 🚽, we start removing unneeded variables and move other ones in `HeaderConfiguration` classes. The current contribution focuses on `user_has_special_access` which is only used by ServiceTracker. By moving the underlying condition, we can reduce the `$params` mess with a baby step. We introduce a usage of `session_require()` call in ServiceTracker which is not great, but refactoring this should be a dedicated contribution. Bonus: the check of global tracker administrator was broken (I didn't manage to know for how long). It is now fixed: users not members of project, can access trackers if they have Global Tracker Administrator permission delegation. Part of story #34002: see promoted trackers in sidebar Change-Id: Ibdd47bd780417972b633d66d20e2230b7ffd6983

Modified Files

Name
M plugins/tracker/include/ServiceTracker.class.php +4 −1 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Artifact.php +7 −1 Go to diff View file
M plugins/tracker/include/Tracker/Permission/PermissionChecker.class.php +10 −15 Go to diff View file
M plugins/tracker/include/Tracker/Permission/PermissionRetrieveAssignee.class.php +1 −7 Go to diff View file
M plugins/tracker/include/Tracker/Tracker.class.php +2 −1 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Permission/PermissionCheckerTest.php +29 −24 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Permission/Tracker_Permission_PermissionChecker_SubmitterOnlyAndAdminTest.php +2 −1 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Permission/Tracker_Permission_PermissionChecker_SubmitterOnlyTest.php +2 −1 Go to diff View file
M src/www/include/html.php +0 −6 Go to diff View file