Both side privileges

Started by Jean-Philippe Chenelover 5 years ago4 messagesgeneral
Jump to latest
#1Jean-Philippe Chenel
jp.chenel@LIVE.CA

Hi,

I try to give userA privileges on userB objects and same thing to the userB, giving privileges on userA objects.

Grant userB to userA; —ok
Grant userA to userB; —error: role userB is already member of role userA

How can I do that?
With best regards,

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Jean-Philippe Chenel (#1)
Re: Both side privileges

On Mon, Jul 13, 2020 at 4:42 PM Jean-Philippe Chenel <jp.chenel@live.ca>
wrote:

Hi,

I try to give userA privileges on userB objects and same thing to the
userB, giving privileges on userA objects.

Grant userB to userA; —ok
Grant userA to userB; —error: role userB is already member of role userA

Create a "group role" that retains ownership and then add both users to
that group.

David J.

#3Jean-Philippe Chenel
jp.chenel@LIVE.CA
In reply to: David G. Johnston (#2)
Re: Both side privileges

Thank for your answer David.
This is what I'll do.
________________________________
De : David G. Johnston <david.g.johnston@gmail.com>
Envoyé : 13 juillet 2020 19:46
À : Jean-Philippe Chenel <jp.chenel@live.ca>
Cc : pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Objet : Re: Both side privileges

On Mon, Jul 13, 2020 at 4:42 PM Jean-Philippe Chenel <jp.chenel@live.ca<mailto:jp.chenel@live.ca>> wrote:
Hi,

I try to give userA privileges on userB objects and same thing to the userB, giving privileges on userA objects.

Grant userB to userA; —ok
Grant userA to userB; —error: role userB is already member of role userA

Create a "group role" that retains ownership and then add both users to that group.

David J.

#4Toomas Kristin
toomas.kristin@gmail.com
In reply to: Jean-Philippe Chenel (#3)
Re: Both side privileges

And please be sure that default permissions are defined properly. Otherwise it may happen that userA creates a new table but userB has access for that. Alternative option is that user has to grant proper access for the role group after every time when a new db object is created.

Toomas

Show quoted text

On 14. Jul 2020, at 16:36, Jean-Philippe Chenel <jp.chenel@live.ca> wrote:

Thank for your answer David.
This is what I'll do.
De : David G. Johnston <david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>>
Envoyé : 13 juillet 2020 19:46
À : Jean-Philippe Chenel <jp.chenel@live.ca <mailto:jp.chenel@live.ca>>
Cc : pgsql-general@lists.postgresql.org <mailto:pgsql-general@lists.postgresql.org> <pgsql-general@lists.postgresql.org <mailto:pgsql-general@lists.postgresql.org>>
Objet : Re: Both side privileges

On Mon, Jul 13, 2020 at 4:42 PM Jean-Philippe Chenel <jp.chenel@live.ca <mailto:jp.chenel@live.ca>> wrote:
Hi,

I try to give userA privileges on userB objects and same thing to the userB, giving privileges on userA objects.

Grant userB to userA; —ok
Grant userA to userB; —error: role userB is already member of role userA

Create a "group role" that retains ownership and then add both users to that group.

David J.