Re: How to remove user specific grant and revoke - Mailing list pgsql-general

From Andrus
Subject Re: How to remove user specific grant and revoke
Date
Msg-id 3d59b000-0964-4a32-faab-ea8a3adf10b8@hot.ee
Whole thread Raw
In response to Re: How to remove user specific grant and revoke  (Andrus <kobruleht2@hot.ee>)
Responses Re: How to remove user specific grant and revoke
List pgsql-general
Hi!

Should I ran separate revoke commands for every user to remove those revokes ? How to remove user-spefic grants ?

After running revoke commands in psql, GRANT commands disappeared magically. It looks like pgAdmin does not allow execute REVOKO commands.

After running script which adds user group tabel modification rights for admin users:

CREATE POLICY kaspriv_sel_policy ON kaspriv FOR SELECT USING (true);
CREATE POLICY kaspriv_mod_policy ON kaspriv USING (
  lower(kasutaja)= current_user OR kasutaja in
    ( select kasutaja from kasutaja where ','||firmad||','
    LIKE '%,'|| (select firmad from kasutaja where lower(kasutaja)= current_user) || ',%'
    )
);
ALTER TABLE kaspriv  ENABLE ROW LEVEL SECURITY;
revoke all on kaspriv from public;
grant select on kaspriv to public;
grant insert, update, delete on kaspriv to admin1, admin2;

pgAdmin shows revoke commands for those users:

REVOKE ALL ON TABLE public.kaspriv FROM admin1;
REVOKE ALL ON TABLE public.kaspriv FROM admin2;

How to prevent pgAdmin to show those revokes?

Andrus.

pgsql-general by date:

Previous
From: Andrus
Date:
Subject: Re: How to remove user specific grant and revoke
Next
From: Erik Wienhold
Date:
Subject: Re: How to remove user specific grant and revoke