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
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.
Diff Revision 2
This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.
orig
1
2
3
docs/codebase/unit-tests/fixtures.txt |
---|
reviewboard/urls.py |
---|
reviewboard/reviews/managers.py |
---|
reviewboard/reviews/models.py |
---|
reviewboard/reviews/tests.py |
---|
reviewboard/reviews/views.py |
---|
reviewboard/reviews/fixtures/test_reviewrequests.json |
---|
reviewboard/scmtools/models.py |
---|
reviewboard/scmtools/fixtures/test_scmtools.json |
---|
reviewboard/site/models.py |
---|
reviewboard/site/tests.py |
---|
reviewboard/site/fixtures/test_site.json |
---|
reviewboard/webapi/decorators.py |
---|
reviewboard/webapi/encoder.py |
---|
reviewboard/webapi/json.py |
---|
reviewboard/webapi/resources.py |
---|
reviewboard/webapi/tests.py |
---|
reviewboard/webapi/urls.py |
---|