Skip to content

Fix: Verhindere Admin-Aussperrung im Impersonate-Modus bei aktivem Wa…#50

Merged
skerbis merged 1 commit intomainfrom
fix-admin-lockout-impersonate-mode
Nov 6, 2025
Merged

Fix: Verhindere Admin-Aussperrung im Impersonate-Modus bei aktivem Wa…#50
skerbis merged 1 commit intomainfrom
fix-admin-lockout-impersonate-mode

Conversation

@skerbis
Copy link
Member

@skerbis skerbis commented Nov 6, 2025

…rtungsmodus

  • Füge Prüfung für Impersonator-Berechtigung in checkBackend() hinzu
  • Admins können sich jetzt nicht mehr selbst aussperren, wenn sie im Wartungsmodus die Identität eines anderen Benutzers annehmen
  • Löst GitHub Issue Admin wird aus Backend ausgesperrt #49: Admin wird aus Backend ausgesperrt

Die Änderung erweitert die checkBackend()-Methode um eine zusätzliche Prüfung: Wenn sich ein Benutzer im Impersonate-Modus befindet, wird geprüft, ob der ursprüngliche Benutzer (Impersonator) ein Administrator ist. Falls ja, wird der Zugriff gewährt, auch wenn der aktuell 'verkörperte' Benutzer kein Administrator ist.

…rtungsmodus

- Füge Prüfung für Impersonator-Berechtigung in checkBackend() hinzu
- Admins können sich jetzt nicht mehr selbst aussperren, wenn sie im
  Wartungsmodus die Identität eines anderen Benutzers annehmen
- Löst GitHub Issue #49: Admin wird aus Backend ausgesperrt

Die Änderung erweitert die checkBackend()-Methode um eine zusätzliche
Prüfung: Wenn sich ein Benutzer im Impersonate-Modus befindet, wird
geprüft, ob der ursprüngliche Benutzer (Impersonator) ein Administrator
ist. Falls ja, wird der Zugriff gewährt, auch wenn der aktuell
'verkörperte' Benutzer kein Administrator ist.
Copilot AI review requested due to automatic review settings November 6, 2025 11:32
@skerbis skerbis merged commit d24df0c into main Nov 6, 2025
2 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds impersonation mode support to the backend maintenance check. When a user is impersonating another user, the system now checks if the original impersonator is an admin, allowing admin impersonators to bypass backend maintenance mode.

  • Adds impersonator admin check to allow admins to access backend during maintenance mode when impersonating other users

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +228 to +232
// Im Impersonate-Modus: Prüfen, ob der ursprüngliche Benutzer (Impersonator) ein Admin ist
$impersonator = rex::getImpersonator();
if ($impersonator instanceof rex_user && $impersonator->isAdmin()) {
return;
}
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The impersonator check grants admin privileges during backend maintenance mode, but this creates a security concern: an admin could impersonate a non-admin user to test restricted functionality, but still bypass maintenance mode restrictions. This defeats the purpose of testing how non-admin users experience the maintenance mode. Consider whether this bypass should only apply when the current user (rex::getUser()) is also an admin, or if the impersonator check should be removed to ensure proper testing of the maintenance experience for non-admin users.

Suggested change
// Im Impersonate-Modus: Prüfen, ob der ursprüngliche Benutzer (Impersonator) ein Admin ist
$impersonator = rex::getImpersonator();
if ($impersonator instanceof rex_user && $impersonator->isAdmin()) {
return;
}
// Hinweis: Impersonator-Check entfernt, damit Admins im Impersonate-Modus nicht Wartungsmodus umgehen können

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants