pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
sql user management
3+ messages / 2 participants
[nested] [flat]

* sql user management
@ 2001-05-28 10:14  Vladislav Breus <vlad@dtr.donetsk.ua>
  0 siblings, 0 replies; 3+ messages in thread

From: Vladislav Breus @ 2001-05-28 10:14 UTC (permalink / raw)
  To: pgsql-sql

With SQL requests I can create, change privileges of the user...

Can I access to user information only with sql-requests ?
- Is the user a member of group <group> ?
- Has he rights to table <table>  ?



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

* sql user management
@ 2001-05-28 14:03  Vladislav Breus <vlad@dtr.donetsk.ua>
  0 siblings, 1 reply; 3+ messages in thread

From: Vladislav Breus @ 2001-05-28 14:03 UTC (permalink / raw)
  To: pgsql-sql

With SQL requests I can create, change privileges of the user...

Can I access to user information only with sql-requests ?
- Is the user a member of group <group> ?
- Has he rights to table <table>  ?



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

* Re: sql user management
@ 2001-05-29 14:27  george young <gry@ll.mit.edu>
  parent: Vladislav Breus <vlad@dtr.donetsk.ua>
  0 siblings, 0 replies; 3+ messages in thread

From: george young @ 2001-05-29 14:27 UTC (permalink / raw)
  To: Vladislav Breus <vlad@dtr.donetsk.ua>; +Cc: pgsql-sql

On Mon, 28 May 2001 17:03:32 +0300
Vladislav Breus <vlad@dtr.donetsk.ua> wrote:

> With SQL requests I can create, change privileges of the user...
> 
> Can I access to user information only with sql-requests ?
> - Is the user a member of group <group> ?

Use the contrib module 'array':
[cd $SOURCE/contrib/array
 make
 make install]

Then, to find what groups 'young' is in, one can do:
   select g.groname from pg_group g, pg_shadow s where s.usename='young' and g.grolist *= s.usesysid;

 or

   select g.grolist *= s.usesysid from pg_group g, pg_shadow s where s.usename='young' and g.groname='originator';

just to see wether or not 'young' is in group 'originator'.

> - Has he rights to table <table>  ?
That's more complicated, but still accessible.  You have to get pg_class.relacl from pg_class where relname='yourtable';
and then parse the acl (access control list) and join with pg_group info...
Hmm, I haven't tried it -- looks messy...

Good luck,
	George
-- 
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now?  [OK]



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


end of thread, other threads:[~2001-05-29 14:27 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-28 10:14 sql user management Vladislav Breus <vlad@dtr.donetsk.ua>
2001-05-28 14:03 sql user management Vladislav Breus <vlad@dtr.donetsk.ua>
2001-05-29 14:27 ` george young <gry@ll.mit.edu>

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