pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Permission issues. Please help
5+ messages / 5 participants
[nested] [flat]

* Permission issues. Please help
@ 2018-03-13 22:52 Richard Gbs <richardgbs@yahoo.com>
  2018-03-14 03:48 ` Re: Permission issues. Please help Azimuddin Mohammed <azimeiu@gmail.com>
  2018-03-14 03:52 ` Re: Permission issues. Please help David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Richard Gbs @ 2018-03-13 22:52 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

I am stumped.
I have been trying to create some users/roles with privs and am having no luck. I have tried all the combinations of alter, grants etc with no luck.
Here is my issues.
database "mydb" in schema "public" is owned  user1
there is also a user2 and user3 
The problem is that if user1 create a table in the database user2 and user3 get permission denied for selects and inserts. etc ... And if user2 creates a table user1 and user3 get permission denied. etc ...
I need to have user1,2 and 3 have all the same privileges against any obeject in the database created by any of them.
Can someone give a high level approach to this please?
thanks
RG

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Permission issues. Please help
  2018-03-13 22:52 Permission issues. Please help Richard Gbs <richardgbs@yahoo.com>
@ 2018-03-14 03:48 ` Azimuddin Mohammed <azimeiu@gmail.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Azimuddin Mohammed @ 2018-03-14 03:48 UTC (permalink / raw)
  To: Richard Gbs <richardgbs@yahoo.com>; +Cc: pgsql-admin@lists.postgresql.org

Look up role in postgres , you can create a role and users to that role and
give permission to the role.

On Mar 13, 2018 10:25 PM, "Richard Gbs" <richardgbs@yahoo.com> wrote:

> I am stumped.
>
> I have been trying to create some users/roles with privs and am having no
> luck. I have tried all the combinations of alter, grants etc with no luck.
>
> Here is my issues.
>
> database "mydb" in schema "public" is owned  user1
>
> there is also a user2 and user3
>
> The problem is that if user1 create a table in the database user2 and
> user3 get permission denied for selects and inserts. etc ... And if user2
> creates a table user1 and user3 get permission denied. etc ...
>
> I need to have user1,2 and 3 have all the same privileges against any
> obeject in the database created by any of them.
>
> Can someone give a high level approach to this please?
>
> thanks
>
> RG
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Permission issues. Please help
  2018-03-13 22:52 Permission issues. Please help Richard Gbs <richardgbs@yahoo.com>
@ 2018-03-14 03:52 ` David G. Johnston <david.g.johnston@gmail.com>
  2018-03-14 04:23   ` Re: Permission issues. Please help Steven Crandell <steven.crandell@gmail.com>
  1 sibling, 1 reply; 5+ messages in thread

From: David G. Johnston @ 2018-03-14 03:52 UTC (permalink / raw)
  To: Richard Gbs <richardgbs@yahoo.com>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

On Tuesday, March 13, 2018, Richard Gbs <richardgbs@yahoo.com> wrote:
>
> I need to have user1,2 and 3 have all the same privileges against any
> obeject in the database created by any of them.
>
> Can someone give a high level approach to this please?
>

Create a group with all three as members.  Have them assign ownership of
created objects to said group.

Maybe not the most secure but should meet your stated goal.

David J.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Permission issues. Please help
  2018-03-13 22:52 Permission issues. Please help Richard Gbs <richardgbs@yahoo.com>
  2018-03-14 03:52 ` Re: Permission issues. Please help David G. Johnston <david.g.johnston@gmail.com>
@ 2018-03-14 04:23   ` Steven Crandell <steven.crandell@gmail.com>
  2018-03-14 10:32     ` RE: Permission issues. Please help Ricardo Martin Gomez <rimartingomez@hotmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Steven Crandell @ 2018-03-14 04:23 UTC (permalink / raw)
  To: Richard Gbs <richardgbs@yahoo.com>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

On Tue, Mar 13, 2018 at 8:52 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

> On Tuesday, March 13, 2018, Richard Gbs <richardgbs@yahoo.com> wrote:
>>
>> I need to have user1,2 and 3 have all the same privileges against any
>> obeject in the database created by any of them.
>>
>> Can someone give a high level approach to this please?
>>
>
> Create a group with all three as members.  Have them assign ownership of
> created objects to said group.
>
> Maybe not the most secure but should meet your stated goal.
>
> David J.
>

default privileges might also prove useful in making a setup like this
easier to maintain over the long-term.
e.g.
ALTER DEFAULT PRIVILEGES FOR USER user1 IN SCHEMA public GRANT SELECT ON
TABLES TO user2;

YMMV, but something like this would ensure that user2 is automatically
granted SELECT on any tables created by user1 in schema public.
Combine with role inheritance to help cut down on the number of total
default privs required
\ddp to view default privs

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* RE: Permission issues. Please help
  2018-03-13 22:52 Permission issues. Please help Richard Gbs <richardgbs@yahoo.com>
  2018-03-14 03:52 ` Re: Permission issues. Please help David G. Johnston <david.g.johnston@gmail.com>
  2018-03-14 04:23   ` Re: Permission issues. Please help Steven Crandell <steven.crandell@gmail.com>
@ 2018-03-14 10:32     ` Ricardo Martin Gomez <rimartingomez@hotmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Ricardo Martin Gomez @ 2018-03-14 10:32 UTC (permalink / raw)
  To: Steven Crandell <steven.crandell@gmail.com>; Richard Gbs <richardgbs@yahoo.com>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Hi, Probably you need to grant permission like this

GRANT SELECT ON ALL TABLES IN SCHEMA public TO user1;

GRANT SELECT ON ALL TABLES IN SCHEMA public TO user2;

GRANT SELECT ON ALL TABLES IN SCHEMA public TO user3;

And just each owner can insert or update

______________________
Saludos
Ing. Ricardo Martín Gomez
DBA - SysAdmin
________________________________
De: Steven Crandell <steven.crandell@gmail.com>
Enviado: miércoles, 14 de marzo de 2018 01:23 a.m.
Para: Richard Gbs
Cc: pgsql-admin@lists.postgresql.org
Asunto: Re: Permission issues. Please help



On Tue, Mar 13, 2018 at 8:52 PM, David G. Johnston <david.g.johnston@gmail.com<mailto:david.g.johnston@gmail.com>> wrote:
On Tuesday, March 13, 2018, Richard Gbs <richardgbs@yahoo.com<mailto:richardgbs@yahoo.com>> wrote:
I need to have user1,2 and 3 have all the same privileges against any obeject in the database created by any of them.

Can someone give a high level approach to this please?

Create a group with all three as members.  Have them assign ownership of created objects to said group.

Maybe not the most secure but should meet your stated goal.

David J.

default privileges might also prove useful in making a setup like this easier to maintain over the long-term.
e.g.
ALTER DEFAULT PRIVILEGES FOR USER user1 IN SCHEMA public GRANT SELECT ON TABLES TO user2;

YMMV, but something like this would ensure that user2 is automatically granted SELECT on any tables created by user1 in schema public.
Combine with role inheritance to help cut down on the number of total default privs required
\ddp to view default privs

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2018-03-14 10:32 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13 22:52 Permission issues. Please help Richard Gbs <richardgbs@yahoo.com>
2018-03-14 03:48 ` Azimuddin Mohammed <azimeiu@gmail.com>
2018-03-14 03:52 ` David G. Johnston <david.g.johnston@gmail.com>
2018-03-14 04:23   ` Steven Crandell <steven.crandell@gmail.com>
2018-03-14 10:32     ` Ricardo Martin Gomez <rimartingomez@hotmail.com>

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