pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: george young <gry@ll.mit.edu>
To: Vladislav Breus <vlad@dtr.donetsk.ua>
Cc: pgsql-sql@postgresql.org
Subject: Re: sql user management
Date: Tue, 29 May 2001 10:27:51 -0400
Message-ID: <20010529102751.05572a14.gry@ll.mit.edu> (raw)
In-Reply-To: <3B125AB4.74AB614E@dtr.donetsk.ua>
References: <3B125AB4.74AB614E@dtr.donetsk.ua>

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]



view thread (3+ messages)

Message-ID: <20010529102751.05572a14.gry@ll.mit.edu>
Permalink:  ../20010529102751.05572a14.gry@ll.mit.edu/
Also on:    postgresql.org/message-id/20010529102751.05572a14.gry@ll.mit.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: gry@ll.mit.edu, vlad@dtr.donetsk.ua
  Subject: Re: sql user management
  In-Reply-To: <20010529102751.05572a14.gry@ll.mit.edu>
  References: <3B125AB4.74AB614E@dtr.donetsk.ua> <20010529102751.05572a14.gry@ll.mit.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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