Do a lot of preparatory work for adding local-site rooting to the webapi.

Review Request #1950 — Created Nov. 27, 2010 and submitted — Latest diff uploaded

Information

Review Board
master

Reviewers

Do a lot of preparatory work for adding local-site rooting to the webapi.

This change adds a bunch of infrastructure to prepare for my next changes which
actually add knowledge of local-site infrastructure and URLs to the API. This
includes:

- New test fixtures.

- Local site checking in manager.accessible() and model.is_accessible_by() for
  Group, LocalSite, Repository, and ReviewRequest.

- A fix for a circular import in webapi/encoder.py (this import was only
  circular when running -only- the webapi tests, for some reason).

- A fix for the to_group_deprecated mess (this actually adds local-site
  knowledge to a bit of the deprecated json API, which wasn't planned yet but
  it's nice to clean it up).

- Add a check_local_site decorator which will be used to check for access to the
  local site before returning data or links.

- Add an override of WebAPIResource.get_href which knows how to serialize links
  including the local-site name.
Ran unit tests.