Skip to content

Commit

Permalink
Check for USAGE (instead of MEMBER) privilege in all pg_has_role occu…
Browse files Browse the repository at this point in the history
…rrences
  • Loading branch information
RealGreenDragon authored and martinmarques committed Sep 11, 2024
1 parent f69485c commit 4a28c57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dbutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -2024,13 +2024,13 @@ connection_has_pg_monitor_role(PGconn *conn, const char *subrole)
initPQExpBuffer(&query);
appendPQExpBufferStr(&query,
" SELECT CASE "
" WHEN pg_catalog.pg_has_role('pg_monitor','MEMBER') "
" WHEN pg_catalog.pg_has_role('pg_monitor','USAGE') "
" THEN TRUE ");

if (subrole != NULL)
{
appendPQExpBuffer(&query,
" WHEN pg_catalog.pg_has_role('%s','MEMBER') "
" WHEN pg_catalog.pg_has_role('%s','USAGE') "
" THEN TRUE ",
subrole);
}
Expand Down

0 comments on commit 4a28c57

Please sign in to comment.