reviewboard.webapi.decorators¶
Decorators for API handlers.
- webapi_check_login_required(view_func)¶
A decorator that checks whether login is required on this installation and, if so, checks if the user is logged in. If login is required and the user is not logged in, they’ll get a NOT_LOGGED_IN error.
- webapi_deprecated(deprecated_in, force_error_http_status=None, default_api_format=None, encoders=[])¶
Marks an API handler as deprecated.
deprecated_in
specifies the version that first deprecates this call.force_error_http_status
forces errors to use the specified HTTP status code.default_api_format
specifies the default api format (json or xml) if one isn’t provided.
- webapi_check_local_site(view_func)¶
Checks whether a user has access to a local site given in the URL.
This decorator can be added to get/get_list methods to check whether or not a user should be able to view them given the local site name in the URL.