Files
pgadmin4/web/pgadmin/tools/tests/__init__.py
T
Dave Page ba1984718a Add RBAC regression tests for tool routes, sockets and adhoc ownership
Add regression coverage for the authorisation fixes:

  * test_tool_permissions_required: a consolidated, per-blueprint check
    that logs in as a user with no roles (hence no tool permissions) and
    asserts every gated backend HTTP route across the query tool, grant
    wizard, schema diff, ERD, PSQL and debugger returns 403. This catches
    any future route added to these blueprints without the decorator.
  * test_tool_socket_permissions_required: asserts the schema diff
    compare_database/compare_schema and psql start_process Socket.IO
    handlers refuse a user lacking the tool permission.
  * test_adhoc_connect_server_ownership: asserts that an adhoc connect
    triggered by a non-owner against an administrator-owned shared server
    persists a server row owned by the caller and not shared.

All three are skipped in DESKTOP mode, where every request is
auto-authenticated as the all-permissions DESKTOP_USER.
2026-07-25 00:55:45 +05:30

9 lines
302 B
Python

##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2026, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################