reviewboard.admin.decorators¶
Review Board admin panel-specific decorators
- superuser_required(view)¶
Wrap a view so that is only accessible to superusers.
Unauthenticated users will be redirected to the login page. Logged in users without sufficient permissions will be redirected to a page showing a permission denied error.
This is very similar to Django’s own
staff_member_required()
, except it checks for superuser status instead of staff status.- Parameters:
view (
callable
) – The view to wrap.- Returns:
The wrapped view.
- Return type:
callable
- check_read_only(view)¶
Check whether the site is read only.
If the site is currently in read-only mode, this will redirect to a page indicating that state.
- Parameters:
view (
callable
) – The view to wrap.- Returns:
The wrapped view.
- Return type:
callable