Can I grant permissions to specific set of uids (linux) ?

Started by David Gauthierabout 8 years ago3 messagesgeneral
Jump to latest
#1David Gauthier
davegauthierpg@gmail.com

Hi:

I'd like to grant select, insert, update, delete to a table for a specific
set of uids (linux). All others get select only. Can the DB authenticate
the current linux user and grant access based on the fact that they are
logged in ()IOW, no passwords ? Is this possible ? If so, how ?

Thanks for any help

#2Melvin Davidson
melvin6925@gmail.com
In reply to: David Gauthier (#1)
Re: Can I grant permissions to specific set of uids (linux) ?

On Tue, Mar 6, 2018 at 3:26 PM, David Gauthier <davegauthierpg@gmail.com>
wrote:

Hi:

I'd like to grant select, insert, update, delete to a table for a specific
set of uids (linux). All others get select only. Can the DB authenticate
the current linux user and grant access based on the fact that they are
logged in ()IOW, no passwords ? Is this possible ? If so, how ?

Thanks for any help

*> I'd like to grant select, insert, update, delete to a table for a
specific set of uids (linux). *

*PostgreSQL does not allow permissions based on uid's.*

*The accepted/implemented way of doing that is to:*

*1. CREATE the appropriate _user_ ROLEs.*

*2: Create a GROUP (role that cannot login) with the permissions needed. *
*3. GRANT that GROUP/ROLE to the user ROLEs that need it. -> *

*GRANT role_name [, ...] TO role_name [, ...] [ WITH ADMIN OPTION ]*

*https://www.postgresql.org/docs/current/static/sql-creategroup.html
<https://www.postgresql.org/docs/current/static/sql-creategroup.html&gt;https://www.postgresql.org/docs/current/static/sql-createrole.html
<https://www.postgresql.org/docs/current/static/sql-createrole.html&gt;https://www.postgresql.org/docs/current/static/sql-grant.html
<https://www.postgresql.org/docs/current/static/sql-grant.html&gt;*--
*Melvin Davidson*
*Maj. Database & Exploration Specialist*
*Universe Exploration Command – UXC*
Employment by invitation only!

#3David G. Johnston
david.g.johnston@gmail.com
In reply to: David Gauthier (#1)
Re: Can I grant permissions to specific set of uids (linux) ?

On Tue, Mar 6, 2018 at 1:26 PM, David Gauthier <davegauthierpg@gmail.com>
wrote:

Hi:

I'd like to grant select, insert, update, delete to a table for a specific
set of uids (linux). All others get select only. Can the DB authenticate
the current linux user and grant access based on the fact that they are
logged in ()IOW, no passwords ? Is this possible ? If so, how ?

​see

https://www.postgresql.org/docs/10/static/auth-methods.html#AUTH-PEER

Note it authenticates by the name, not the numeric value.

​If that doesn't cover your need the answer to your question is probably no.

David J.