Thread: Get uasers Group membership

Get uasers Group membership

From
"Bluebottle"
Date:

In an application I want to confirm that a person is a member of a group eg I am looking for a function that receives the userid and groupname, and returns a Boolean yes/no answer. Alternatively, is there a way of listing the members of a groups ( from which I can write my own function)?

 

David

Re: Get uasers Group membership

From
Andreas Kretschmer
Date:
Bluebottle <luckychap@bluebottle.com> schrieb:
> In an application I want to confirm that a person is a member of a group eg I
> am looking for a function that receives the userid and groupname, and returns a
> Boolean yes/no answer. Alternatively, is there a way of listing the members of
> a groups ( from which I can write my own function)?

Hi,

pg_group contains information about groups and users. The fild
'groname' is the name, and grolist is a array of user id's in this
group.

You should select the usesysid from pg_user and then you can search this
id in pg_group. (select ... where $ID in any(grolist);)


untestet, i havn't groups here in my local instalation)



Btw.: dont't write HTML in Mailinglists, please.


Regards, Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°