I think we just need to intersect owner_groups and view_form_groups, since we'll be intersecting view_form_groups with groups up above...the reasoning is, that if the user has a special group scope set, then it doesn't matter what their own groups are, we take the special group scope as an override essentially.  So including $groups at this point in the intersection would screw things up for users with a special scope, who are not members of the group(s) in their special scope (and most of the time, users are not going to be members of the group(s) that are their special scope, that's the whole point of having a special scope)