Forum OpenACS Development: Re: couple of bugs in acs_group__member_p?

Collapse
Posted by Malte Sussdorff on
As Tom has not written anything specific to your problem but just some general advise, which you probably have done so already anyway, let's be specific:

Cascading does refer to sub_relationship_types, not sub_relationships. That might be confusing, especially as the API doc does not show that 😊. So maybe we should explain that in the doc. My initial assumption (before reading this specific code, albeit only for 10 minutes, not two weeks) was that cascade refers to the direct membership and inherited membership (e.g. group of a group).

For a group (or any other party bar person) you need to create a composite_rel and then use composite_rel__new which triggers party_approved_member__add. In party_approved_member_map you can then see the party_id (which happens to be the group_id you look for IN THIS EXAMPLE (it could be any other party, including users)), member_id (which is the party_id that is a member of the group_id) and tag (which is the rel_id if there is any). It also inserts into group_element_index with the composite_rel relationship type, so you could check it there as well.

What you will probably need for your membership check though, is to create a procedure which checks the direct membership for membership_rels and the membership_rels of any composite_rels. You could achieve this by adding "-include_children" switch to group::member_p .

Hope that helped you out a little bit.

Collapse
Posted by Tom Jackson on
The two weeks suggestion only applies if you think you have found a bug, but as you can see, I've really extended that out to forever. I doubt you will find one, so it is hard to be more specific than I have been: stop looking for the bug and just try to figure out what you don't understand about the code. There are only a few people here that know anything about it, as in either wrote the code or tried to use it, or at least I haven't seen any released code to suggest otherwise. Working examples would be the best place to look for ideas. Anyone?