Role Permissions are not inherited to the new objects

From: Rajin Raj <rajin(dot)raj(at)opsveda(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Role Permissions are not inherited to the new objects
Date: 2020-02-17 08:54:17
Message-ID: CAOasRJaMV6Sk7QR2448v1bqNKPgQsK4kt61N0q9ODj8wxDCx4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

Permissions are not inherited to the new objects. I have followed the below
steps,

1. Created a new role "user_role";
2. Created a new schema "test_schema";
3. Granted SELECT ON ALL TABLES IN SCHEMA "test_schema" to "user_role";
4. Grant "user_role" to user_1 and user_2;
5. Create a new table "T1" in "test_schema" using user_1 id.
6. Now login with user_2 and try to query the "T1" table.

Getting permission denied error.

But, if I execute the grant command (step 3) after creating the table
(step 4), this issue is not happening.

Is there any setting in pg to inherit the permissions given at
top-level or refresh the permissions automatically?

*Regards,*
*Rajin *

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Laurenz Albe 2020-02-17 09:55:16 Re: Role Permissions are not inherited to the new objects
Previous Message Dipanshu singh 2020-02-17 06:30:59 How to Import image