Re: CUG
От | Francisco Reyes |
---|---|
Тема | Re: CUG |
Дата | |
Msg-id | Pine.BSF.4.32.0102031854080.9740-100000@zoraida.reyes.somos.net обсуждение исходный текст |
Ответ на | Re: CUG (Nabil Sayegh <nsmail@sayegh.de>) |
Список | pgsql-novice |
On Sat, 3 Feb 2001, Nabil Sayegh wrote: > It's clear that everybody has the permissions that guests have. > Members of family shall also(automatically) have the permissions > that friends have ... I thought you wanted something more complex. From what I understand you could implement "levels". When you put a picture you indicate what level the person needs. A picture with level 0 can be seen by anybody. A picture with level 1 can be seen by anyone with leve 1 and above.. Get it? > I want the same group management like under unix. Not really. :-) > How shall I know that family may see 'guest-pictures' ? The "level" scheme accomplishes this. > Without groups in groups its easy to SELECT the pictures somebody has > access to, but with ? > What if later I want to give all colleagues the rights that my > friends have (stupid example, I know ...) Another way which is more flexible, although a bit more complex, is to allow someone to belong to different groups and to have each picture allowable to more than one group. Something like --picture table pictureID Description 1 graduation 2 dance party 3 at the library 4 getting out of shower 5 nude --group table groupID Description 1 Guest 2 friends 3 girlfriend --user table personID groupID 1 guest 2 friend 3 girlfriend -user_group userID groupID 1 1 2 1 2 2 3 3 --Picture table pictureID groupID 1 1 2 1 3 1 4 2 5 3 That should work for what you described with no problems (except if you have more than one user on the girlfriend category, then you could eventually have serious problems with this setup) <G> The query for a setup like this would be a 3 way join between user, group and the picture table. Something like select picture.PictureID, from picture, user_group where userVAR = user_group.userID and user_group.groupID = picture.groupID I didn't test the query and didn't looked at it for too long, but it would be something simmilar if not that. Based on you request I think the "levels" is by far the easiest way to accomplish what I understood you asked for. Hope this helped.
В списке pgsql-novice по дате отправления: