fix: remove admin bypass from server access helpers (#9933) (#10006)
In server mode, administrators were auto-granted visibility into every user's private server groups and servers via four _is_admin() bypasses in server_access.py. This made the Object Explorer show a separate top-level "Servers" entry per user when logged in as admin, exposing private connections the admin should have no access to. The Administrator role in pgAdmin governs management of pgAdmin itself (users, preferences) — it is not intended to inherit other users' database credentials and connection state. Cross-user visibility requires explicit sharing (Server.shared=True), same as for any user. Remove the admin bypass from get_server, get_server_group, get_server_groups_for_user, and get_user_server_query. Drop the now- unused _is_admin() helper. Update docstrings to make the policy explicit. Add a regression test (admin attempts to fetch a non-admin user's private server group → expect HTTP 410). The original isolation test only covered non-admin → admin, which is why the regression introduced by 9a76ed8 was not caught.
A
Ashesh Vashi committed
148705994d323afc3c2c9f42e4ca27d458922370
Parent: 679c39f
Committed by GitHub <noreply@github.com>
on 6/6/2026, 3:40:59 AM