pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrus <kobruleht2@hot.ee>
To: Erik Wienhold <ewie@ewie.name>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: How to remove user specific grant and revoke
Date: Sun, 4 Jun 2023 00:34:32 +0300
Message-ID: <2751c0ad-1e40-2aa4-eab6-6d3e0f1ff6bd@hot.ee> (raw)
In-Reply-To: <666755787.808219.1685825876788@office.mailbox.org>
References: <568e6761-d224-7c72-59f3-267b39bde227@hot.ee>
	<2140448238.796716.1685796376553@office.mailbox.org>
	<1408288797.797459.1685797672449@office.mailbox.org>
	<c832dd7d-743e-f77f-e07b-8fbccfb059f4@hot.ee>
	<371357275.803438.1685810290820@office.mailbox.org>
	<cc2dc8b5-ba7d-7652-31f1-4038f778244f@hot.ee>
	<872810576.804014.1685813147131@office.mailbox.org>
	<b35dbd8f-9896-9708-08a8-5a1747c0ece3@hot.ee>
	<c8a918fa-3f8a-0ddd-12a9-85d8b24f3e22@hot.ee>
	<666755787.808219.1685825876788@office.mailbox.org>

Hi!


>> After this command pgAdmin still shows revoke and grant commands for
>> alekspoluh role.
>> How to remove all grant and revoke assignments for role ?
> Please confirm that \dp public.kaspriv no longer shows an ACL for alekspoluh
> after running:
>
> 	REVOKE ALL ON public.kaspriv FROM alekspoluh;
psql (12.2 (Debian 12.2-2.pgdg100+1))
Type "help" for help.

sba=# REVOKE ALL ON public.kaspriv FROM alekspoluh;
REVOKE
sba=# \o result.txt
sba=#  \dp public.kaspriv

sba=# \q

#grep alekspoluh result.txt

Returns nothing. So output does not contain this role.

> There must be something wrong with pgAdmin if it still shows REVOKE ALL for
> that role after its ACL is gone.  Looking at the code, pgAdmin emits REVOKE ALL
> for any grantee it find in the ACL.
>
> https://github.com/pgadmin-org/pgadmin4/blob/REL-7_2/web/pgadmin/browser/server_groups/servers/datab...

I re-opened pgadmin.  alekspoluh role is no more displayed in kaspriv 
table sql window.

pgadmin shows only single reset role command. Now it shows

REVOKE ALL ON TABLE public.kaspriv FROM yllelohmus;

I ran

REVOKE ALL ON TABLE public.kaspriv FROM yllelohmus;

After that pgadmin shows next single revoke command:

REVOKE ALL ON TABLE public.kaspriv FROM villuuus;

It looks like pgAdmin shows only one REVOKE command but actually there 
are more revokes.

Should I ran separate revoke commands for every user to remove those 
revokes ?

pgAdmin also shows about 100 grant commands for users like

GRANT SELECT ON TABLE public.kaspriv TO paide;

How to remove user-spefic grants ?

Andrus.

view thread (12+ messages)  latest in thread

Message-ID: <2751c0ad-1e40-2aa4-eab6-6d3e0f1ff6bd@hot.ee>
Permalink:  ../2751c0ad-1e40-2aa4-eab6-6d3e0f1ff6bd@hot.ee/
Also on:    postgresql.org/message-id/2751c0ad-1e40-2aa4-eab6-6d3e0f1ff6bd@hot.ee

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: kobruleht2@hot.ee, ewie@ewie.name
  Subject: Re: How to remove user specific grant and revoke
  In-Reply-To: <2751c0ad-1e40-2aa4-eab6-6d3e0f1ff6bd@hot.ee>
  References: <568e6761-d224-7c72-59f3-267b39bde227@hot.ee> <2140448238.796716.1685796376553@office.mailbox.org> <1408288797.797459.1685797672449@office.mailbox.org> <c832dd7d-743e-f77f-e07b-8fbccfb059f4@hot.ee> <371357275.803438.1685810290820@office.mailbox.org> <cc2dc8b5-ba7d-7652-31f1-4038f778244f@hot.ee> <872810576.804014.1685813147131@office.mailbox.org> <b35dbd8f-9896-9708-08a8-5a1747c0ece3@hot.ee> <c8a918fa-3f8a-0ddd-12a9-85d8b24f3e22@hot.ee> <666755787.808219.1685825876788@office.mailbox.org> <2751c0ad-1e40-2aa4-eab6-6d3e0f1ff6bd@hot.ee>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox