Forum OpenACS Development: Re: Group membership

Collapse
9: Re: Group membership (response to 1)
Posted by Dave Bauer on
In the link provided it says

"We start with Groups, which contain members; the member can be either a person or another group (i.e. a member is a party)."

So the problem is what does "contain" mean here.

I think most folks would think if members can be groups than a group can have a membership relationship to another group. I guess the question is whether the membership relationship is inherited by the groups members or not.

Aha here is the mathematical descripton of the Sierra Club example.

A group Gc can be a member and/or a component of another group Gp; the difference is in the way the members of Gc are related to Gp:

*

If a party P is a member (or a component) of Gc and if Gc is a component of Gp, then P is also a member (or a component) of Gp
*

If a party P is a member (or a component) of Gc and if Gc is a member of Gp, then no relationship between P and Gp exists as a result of the relationship between Gp and Gp.

According to the design doc it IS possible to model what I said it was impossible to model. I wonder if it works or not.

We see:
openacs-5-3=# select membership_rel__new(1030,1036);
ERROR: -20001: membership_rel violation: Invalid object types. Object 1030 (group) must be of type group Object 1036 (group) must be of type person
CONTEXT: SQL statement "insert into acs_rels (rel_id, rel_type, object_id_one, object_id_two) values ( $1 , $2 , $3 , $4 )"
PL/pgSQL function "acs_rel__new" line 25 at SQL statement
PL/pgSQL function "membership_rel__new" line 11 at assignment
PL/pgSQL function "membership_rel__new" line 5 at return

It does not work. IT says ONLY persons may be members of groups, which is what Malte has been trying to fix. Its clear the original design document says any party may be a member of a group. This may have changed when relational_segments were added to the data model.

Its not clear, I checked the earliest code OpenACS has and membership rel always required a group and a person.
attr_id := acs_rel_type__create_type (
''membership_rel'',
''Membership Relation'',
''Membership Relationships'',
''membership_rels'',
''rel_id'',
''membership_rel'',
''group'',
null,
0,
null,
''person'',
''member'',
0,
null
);

To change that now we'd need a comprehensive test suite to prove correctness of security and memebership inheritance. I think it would be cool if it was fixed because it would be much simpler for end users as composition rels are quite hard for people to understand.

Collapse
10: Re: Group membership (response to 9)
Posted by Malte Sussdorff on
Thanks Dave for looking into this. Great to know that it actually seems to be a bug or outdated design docs.

Russell, what we (meaning you, Matthew and myself) can do is play around with it when we change the constraint from persons to parties.

For our stuff it will work 100%, but we are not relying on permissions, so maybe you can test that one and between the three of us we figure out how to get it to work.