Re: Creating a role with read only privileges but user is allowed to change password

Поиск
Список
Период
Сортировка
От Ravi Roy
Тема Re: Creating a role with read only privileges but user is allowed to change password
Дата
Msg-id CAFMBnF_0+JrRe0sUuGq2ndyFEWaULuyBXfUZmtPJB2C1rUq9mg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Creating a role with read only privileges but user is allowed to change password  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Creating a role with read only privileges but user is allowed to change password
Список pgsql-general
Thanks a lot Tom, it worked by putting off the read only mode to off before changing the password and putting it on again.

> SET default_transaction_read_only = off;

Worked for me.. 

Many thanks to you!

Regards
Ravi


On Sun, May 11, 2014 at 10:26 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Ravi Roy <ravi.aroy@gmail.com> writes:
> I've created a role named "MyRole" in posgresql with the following :

> CREATE ROLE "MyRole" NOSUPERUSER LOGIN NOCREATEDB NOCREATEROLE NOINHERIT
> PASSWORD "MyPassword";

> ALTER ROLE "MyRole" set default_transaction_read_only = on;

> Because I wanted this role to readonly (can not change anything in DB but
> only view).

You realize, I hope, that breaking out of that restriction is no harder
than issuing

SET default_transaction_read_only = off;

or even

BEGIN TRANSACTION READ WRITE;

So that ALTER ROLE might be of some use as a protection against accidental
changes, but it's certainly no form of security restriction.  (What you
probably want to do instead of this is make sure the role doesn't have
select/update/delete privileges for any of your tables.)

> But later I realized this role is not even allowed to change his password.

Just do one of the above things first...

                        regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Ravi Roy
Дата:
Сообщение: Re: Creating a role with read only privileges but user is allowed to change password
Следующее
От: Tim Kane
Дата:
Сообщение: Re: Re: Partitioning such that key field of inherited tables no longer retains any selectivity