Reset permissions on table

Started by Nonameabout 13 years ago5 messagesgeneral
Jump to latest
#1Noname
etienne.champetier@free.fr

Hi

By default there is no permissions on table (\dp return 0 row)
If I make a GRANT, doing a REVOKE will not get me in the 'default' state

How to return in the default state, where permission are 'inherited' from owner.

Thanks in advance

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Noname (#1)
Re: Reset permissions on table

etienne champetier wrote:

By default there is no permissions on table (\dp return 0 row)
If I make a GRANT, doing a REVOKE will not get me in the 'default' state

How to return in the default state, where permission are 'inherited' from owner.

\dp should return a row for each table in
your search_path.

I assume that you are referring to the empty
"Access privileges" column.

After granting and revoking a privilege, the value
showd be "owner=arwdDxt/owner" (where "owner" is
the user that owns the table).

This is the default value: the owner has all
privileges and nobody else has any.

It does not matter if the ACL is left empty
(it contains a NULL value initially) or if
it contains the default explicitly.

Yours,
Laurenz Albe

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Noname
etienne.champetier@free.fr
In reply to: Laurenz Albe (#2)
Re: Reset permissions on table

----- Mail original -----

De: "Albe Laurenz" <laurenz.albe@wien.gv.at>
À: "etienne.champetier@free.fr *EXTERN*" <etienne.champetier@free.fr>, pgsql-general@postgresql.org
Envoyé: Vendredi 15 Février 2013 13:25:14
Objet: RE: [GENERAL] Reset permissions on table

etienne champetier wrote:

By default there is no permissions on table (\dp return 0 row)
If I make a GRANT, doing a REVOKE will not get me in the 'default'
state

How to return in the default state, where permission are
'inherited' from owner.

\dp should return a row for each table in
your search_path.

Sorry, i meant \dp <table-name> and it effectively return 1 row per table (mistype ...)

I assume that you are referring to the empty
"Access privileges" column.

After granting and revoking a privilege, the value
showd be "owner=arwdDxt/owner" (where "owner" is
the user that owns the table).

This is the default value: the owner has all
privileges and nobody else has any.

It does not matter if the ACL is left empty
(it contains a NULL value initially) or if
it contains the default explicitly.

If i do a GRANT and a REVOKE, i loose access to the table.
\dp <table-name> return the same thing but before GRANT it's NULL and after REVOKE it's not.

It matter when you want to change owner and you forgot this table where there is explicit right.

Yours,
Laurenz Albe

Thanks for your quick answer

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Noname (#3)
Re: Reset permissions on table

etienne champetier wrote:

By default there is no permissions on table (\dp return 0 row)
If I make a GRANT, doing a REVOKE will not get me in the 'default'
state

How to return in the default state, where permission are
'inherited' from owner.

\dp should return a row for each table in
your search_path.

Sorry, i meant \dp <table-name> and it effectively return 1 row per table (mistype ...)

I assume that you are referring to the empty
"Access privileges" column.

After granting and revoking a privilege, the value
showd be "owner=arwdDxt/owner" (where "owner" is
the user that owns the table).

This is the default value: the owner has all
privileges and nobody else has any.

It does not matter if the ACL is left empty
(it contains a NULL value initially) or if
it contains the default explicitly.

If i do a GRANT and a REVOKE, i loose access to the table.
\dp <table-name> return the same thing but before GRANT it's NULL and after REVOKE it's not.

It matter when you want to change owner and you forgot this table where there is explicit right.

I don't understand - it seems to work for me:

CREATE TABLE test(id integer PRIMARY KEY);

\dp test
Access privileges
Schema | Name | Type | Access privileges | Column access privileges
---------+------+-------+-------------------+--------------------------
laurenz | test | table | |
(1 row)

REVOKE SELECT ON test FROM georg;

\dp test
Access privileges
Schema | Name | Type | Access privileges | Column access privileges
---------+------+-------+-------------------------+--------------------------
laurenz | test | table | laurenz=arwdDxt/laurenz |
(1 row)

These are the default privileges.

ALTER TABLE test OWNER TO georg;

\dp test
Access privileges
Schema | Name | Type | Access privileges | Column access privileges
---------+------+-------+---------------------+--------------------------
laurenz | test | table | georg=arwdDxt/georg |
(1 row)

The table still has the default privileges,
but now it belongs to "georg".

Maybe you can illustrate your problem with an example.

Yours,
Laurenz Albe

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Noname (#3)
Re: Reset permissions on table

On 02/15/2013 05:02 AM, etienne.champetier@free.fr wrote:

If i do a GRANT and a REVOKE, i loose access to the table.
\dp <table-name> return the same thing but before GRANT it's NULL and after REVOKE it's not.

It matter when you want to change owner and you forgot this table where there is explicit right.

If it is a matter of finding who the table owner is then do:

\dt table_name

Yours,
Laurenz Albe

Thanks for your quick answer

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general