Forum OpenACS Development: Re: Cannot delete groups with segments and rels
There is a bug (http://openacs.org/bugtracker/openacs/bug?bug_number=234), filed by Tilmann back in February, that discusses the bothersome necessity to delete permissions assigned to an object prior to deleting the object. The problem is much larger and more pervasive than the groups issue you encountered. The ensuing discussion seemed to establish that a cascaded delete from acs_objects to acs_permissions was appropriate.
The patch (http://openacs.org/bugtracker/openacs/patch?patch_number=74) that was submitted to close the bug on that same day doesn't address a cascaded delete that I can see. It does "delete from acs_permissions..." when an object is deleted. Which should guarantee that permissions are deleted before the acs_object.
Somebody that's more familiar with the groups system needs to state whether the suggestion you make (deleting perms from within acs_group__delete) is essentially equivalent to the issue that was resolved by Til's bug/patch, and then apply that change if it's appropriate.
My vote would support such a change if some kernel guru thinks it's the right thing to do.
Don? Til? Jeff?