Well the good news is I applied your patch and deleting groups now works except when I've already assigned permissions to the group or its rel_segs. Then I get
ERROR: acs_permissions_grantee_id_fk referential integrity violation - key in parties still referenced from acs_permissions.
acs_group__delete could add code to drop permissions first? Or a delete cascade on group and rel_segs? I haven't found a way to mass delete permissions yet, only permission::revoke.
Am I missing something more obvious here?