Forum OpenACS Q&A: Response to Composite/Component/Membership group setup

Posted by Tilmann Singer on
To my understanding there are those two basic type of relationships: composition and membership.

Persons and their subtype users can be related to groups only via the membership relationship, e.g. one user can be a member of one group.

According to /doc/permissions.html I thought that on the other hand, groups can be related to each other either via membership or via composition relationship. In the latter case the parent group would inherit all the members from the child group so that they appear as members of the parent as well, in the first case they would not be inherited.

But at the groups admin pages it seems that one group can only be related to another group via the composition relationship, because when I select "Add a member" it does not offer me groups. Don't know why, maybe an oddity of the groups admin pages. (Actually I find it hard to imagine a scenario where one would want a group to be a member of another group).

But what you want anyway is to make one group a _component_ (=composition relationship) of another group.

The members of the contained group will appear as members of the container group - but again not in the groups admin pages - I think those will only display direct members. Look at the view group_element_index for example, which will list you all members. Or try the following: Make group B a component of group A, and user X a user profile (member) of group B. Now grant a certain privilege to group A and check if user X inherits the privilege.