General-purpose decorators for use with Horizon.
Performs user authentication check.
Similar to Django’s login_required decorator, except that this throws
NotAuthenticatedexception if the user is not signed-in.
Perform component can_access check to access the view.
:param component containing the view (panel or dashboard).
NotAuthorizedexception if the user cannot access the component containing the view. By example the check of component policy rules will be applied to its views.
Enforces permission-based access controls.
required (list) – A tuple of permission names, all of which the request user must possess in order access the decorated view.
from horizon.decorators import require_perms @require_perms(['foo.admin', 'foo.member']) def my_view(request): ...
NotAuthorizedexception if the requirements are not met.