Add support for hidden groups.
Review Request #1904 — Created Nov. 10, 2010 and submitted
Add support for hidden groups. Hidden groups are groups that are not shown unless a user is a member of it or otherwise knows about it (for example, has starred the group). A hidden group may be invite-only, but it doesn't have to be. This allows administrators to deprecate a group or to hide invite-only groups, much like repositories. The group won't appear in the group auto-complete, the All Groups list, or the API results, unless the user is a member of the group. In order to make that filtering work, a new GroupManager has been added that provides an accessible() query function. It takes a user and uses it to filter the results by ones the user has access to. It works on the same criteria as Group.is_accessible_by(). It can also restrict to a local_site and can optionally show even non-visible groups. The Group admin page has been updated to categorize the options better.
Unit tests all pass. Verified that the hidden groups are filtered out from the All Groups page and the groups auto-complete. Checked that the admin UI's organization now looks sane.