Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q5Yua-0002HH-7Z for pgsql-general@arkaria.postgresql.org; Sat, 03 Jun 2023 21:35:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q5YtZ-0008Ik-BN for pgsql-general@arkaria.postgresql.org; Sat, 03 Jun 2023 21:34:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q5YtZ-0008Ib-0N for pgsql-general@lists.postgresql.org; Sat, 03 Jun 2023 21:34:45 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q5YtW-0002uS-3I for pgsql-general@postgresql.org; Sat, 03 Jun 2023 21:34:44 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 0EC543B78; Sun, 4 Jun 2023 00:34:41 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LQzv6bn8NSLr; Sun, 4 Jun 2023 00:34:38 +0300 (EEST) Received: from mail.hot.ee (hot-relayhost2.estpak.ee [213.180.2.80]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 6B21D3AE1; Sun, 4 Jun 2023 00:34:38 +0300 (EEST) Content-Type: multipart/alternative; boundary="------------HjEgfQbv2QZIVAex8q8cy7ob" Message-ID: <2751c0ad-1e40-2aa4-eab6-6d3e0f1ff6bd@hot.ee> Date: Sun, 4 Jun 2023 00:34:32 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: How to remove user specific grant and revoke Content-Language: et To: Erik Wienhold , pgsql-general References: <568e6761-d224-7c72-59f3-267b39bde227@hot.ee> <2140448238.796716.1685796376553@office.mailbox.org> <1408288797.797459.1685797672449@office.mailbox.org> <371357275.803438.1685810290820@office.mailbox.org> <872810576.804014.1685813147131@office.mailbox.org> <666755787.808219.1685825876788@office.mailbox.org> From: Andrus In-Reply-To: <666755787.808219.1685825876788@office.mailbox.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------HjEgfQbv2QZIVAex8q8cy7ob Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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/databases/schemas/tables/utils.py#L712 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. --------------HjEgfQbv2QZIVAex8q8cy7ob Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

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/databases/schemas/tables/utils.py#L712

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.

--------------HjEgfQbv2QZIVAex8q8cy7ob--