mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that the user should be able to kill the session from Dashboard if the user has a 'pg_signal_backend' role. Fixes #6159
This commit is contained in:
committed by
Akshay Joshi
parent
f77fceb1b2
commit
8279e7e01c
@@ -552,12 +552,20 @@ WHERE db.datname = current_database()""")
|
||||
"""
|
||||
status = self._execute(cur, """
|
||||
SELECT
|
||||
oid as id, rolname as name, rolsuper as is_superuser,
|
||||
CASE WHEN rolsuper THEN true ELSE rolcreaterole END as
|
||||
roles.oid as id, roles.rolname as name,
|
||||
roles.rolsuper as is_superuser,
|
||||
CASE WHEN roles.rolsuper THEN true ELSE roles.rolcreaterole END as
|
||||
can_create_role,
|
||||
CASE WHEN rolsuper THEN true ELSE rolcreatedb END as can_create_db
|
||||
CASE WHEN roles.rolsuper THEN true
|
||||
ELSE roles.rolcreatedb END as can_create_db,
|
||||
CASE WHEN 'pg_signal_backend'=ANY(ARRAY(
|
||||
SELECT pg_catalog.pg_roles.rolname FROM
|
||||
pg_catalog.pg_auth_members m JOIN pg_catalog.pg_roles ON
|
||||
(m.roleid = pg_catalog.pg_roles.oid) WHERE
|
||||
m.member = roles.oid)) THEN True
|
||||
ELSE False END as can_signal_backend
|
||||
FROM
|
||||
pg_catalog.pg_roles
|
||||
pg_catalog.pg_roles as roles
|
||||
WHERE
|
||||
rolname = current_user""")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user