Forum OpenACS Q&A: groups question
I'm trying to understand groups, composition and membership relation. From the docs and forums I've gathered some vague understanding of the concepts. Am I right in that the basic difference between composition and membership is transitivity?
that if user X is a part of (i don't if i should use the word member) Group A and Group A has a composite relalation to Groub B then X has a composite relation to Group B also.
where as if user X is a part of Group A and Group A has a member relation to Group B then user X does not necessarily have a relation to Group B.
Is this right?
My practical purpose is that in my site I would like to create group heirarchies as such:
Company Internal Groups
Company Customers Groups
My implementation in OACS is thus:
Company Internal Groups - Group Type
--Managers Group - Group of group type Company Internal Group
----manageruser1 - User composite of Managers Group
--Employees Group - Group of group type Company Internal Group
----employeeuser1 - user composite of Employees Group
Company Customers Groups - Group Type
--Customers - Group of Group Type Company Customers Groups
----CustCompany1 - Group composite of Customers Group
-------CustCompany1user1 - User composite of CustCompany1
-------CustCompany1user2 - User composite of CustCompany1
----CustCompany2 - Group composite of Customers Group
-------CustCompany2user ... - User composite of CustCompany2
Am I totally off in my take on this? As you can see, I didn't use membership relation at all because they are straight up heirarchies. Is this correct? Also is that the proper use of group type?
Also is there an existing function that will give you a user's immediate group. Or can you define a primary group that the user is a member in? I need this for one of my fields. (In the above example, I need to note always that the userA from custcompanyA)
On a side: I've been looking for a list of basic functions liket ad_system_name and the like. Can't seem to find it in the api browser. Can anyone point me to the right place? In particular I'm looking to find some user and group specific functions.
Thanks a lot in advance. Making some progress but I really am not confident in my grasp of some of the concepts and am reluctant to move forward.
Company Internal Groups - Group Type --Managers Group - Group of group type Company Internal Group ----manageruser1 - Member of Managers Group --Employees Group - Group of group type Company Internal Group ----employeeuser1 - Member of Employees Group Company Customers Groups - Group Type --Customers - Group of Group Type Company Customers Groups ----CustCompany1 - Component of Customers Group -------CustCompany1user1 - Member of CustCompany1 -------CustCompany1user2 - Member of CustCompany1 ----CustCompany2 - Component of Customers Group -------CustCompany2user ... - Member of CustCompany2then you are definitely on the right track (I think).
As far as I understand, the difference between the two basic relationship types component and membership only applies to groups. Persons (and users) can only be in membership relation to groups. e.g. a user can never be a component of something.
Another source for confusion is that by default there is a subtype of the membership relation called "user profile". I don't know what it is supposed to do. It propably has a special meaning regarding subsites - I just remember that some time ago I tried to add a user to a group and for some reason I could not select this user when using the "User Profile" relation, it only worked with the plain Membership relation.
To check membership take a look at the plpgsql function acs_group__member_p - It should do exactly what you need. Make sure to have a recent cvs checkout though, because this function was fixed not that long ago.
Creating it makes the groups and related admin UI confusing among other things.
It's not at all clear what was intended with this as the code's obviously incomplete.
Do you have any similar insight on the purpose of the group type "Application Group"? In what regard are groups that are of this type different from normal groups?