[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] perms: Fix perms regression when switching users
"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <68b078ef6f3ab_2cd78e843337@gitlab-sidekiq-low-urgency-cpu-bound-v2-dbf997b86-cd6wk.mail> |
Jonny Bradley pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki Commits: 4fed4a11 by Jonny Bradley at 2025-08-28T15:36:17+00:00 [FIX] perms: Fix perms regression when switching users --- * [FIX] perms: Fix perms regression when switching users --- * [FIX] perms: Fix perms regression when switching users --- * [FIX] perms: Fix perms regression when switching users --- * [FIX] perms: Fix perms regression when switching users part 2 - respect the `$globalize` parameter on activating a permissions context (i.e. don't set the global perm vars unless told to) * [FIX] perms: Fix perms regression when switching users by restoring the switched to user's perms context See merge request tikiwiki/tiki!8401 (cherry picked from commit 0ec7e6dc9f7cc2485126491d6af7d2b55a95d00a) 0131964d [FIX] perms: Fix perms regression when switching users by restoring the... 1b7bef05 [FIX] perms: Fix perms regression when switching users part 2 - respect the... Co-authored-by: Jonny Bradley <[email protected]> See merge request tikiwiki/tiki!8436 (cherry picked from commit 61cc8311fffc0a62d6ce2a22af82847b9c3f46dc) 2f513adc [FIX] perms: Fix perms regression when switching users Co-authored-by: Jonny Bradley <[email protected]> See merge request tikiwiki/tiki!8437 (cherry picked from commit 7512351fc15d5fbaba9462f82d00aeabbd7ac01a) 0546b9ac [FIX] perms: Fix perms regression when switching users Co-authored-by: Jonny Bradley <[email protected]> See merge request tikiwiki/tiki!8444 - - - - - 2 changed files: - lib/core/Perms/Context.php - modules/mod-func-login_box.php Changes: ===================================== lib/core/Perms/Context.php ===================================== @@ -47,15 +47,18 @@ class Perms_Context $perms = Perms::getInstance(); $this->previousUser = $user; $this->previousGroupList = $perms->getGroups(); - $smarty = TikiLib::lib('smarty'); $user = $this->user; $perms->setGroups($this->groupList); - $globalperms = Perms::get(); - $globalperms->globalize(self::$permissionList, $smarty, false); + if ($globalize) { + $smarty = TikiLib::lib('smarty'); + $globalperms = Perms::get(); - if (is_object($smarty)) { - $smarty->assign('globalperms', $globalperms); + $globalperms->globalize(self::$permissionList, $smarty, false); + + if (is_object($smarty)) { + $smarty->assign('globalperms', $globalperms); + } } } ===================================== modules/mod-func-login_box.php ===================================== @@ -126,6 +126,8 @@ function module_login_box($mod_reference, &$module_params) if (! $permsPrevious->admin) { $can_switch_user = 'n'; } + // restore the current "switched to" user's permissions + unset($permsContext); } else { $can_switch_user = 'n'; } View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/4fed4a1192ec11854d00a00f0f8f7e5ba725444a -- View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/4fed4a1192ec11854d00a00f0f8f7e5ba725444a You're receiving this email because of your account on gitlab.com. _______________________________________________ TikiWiki-cvs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs