views

Admin view class factory for creating protected admin views on-the-fly.

views._has_admin_access()

Function used to check if a user has any admin access.

views.init_menu()

Initialize menu before first request.

views.protected_adminview_factory(base_class)

Factory for creating protected admin view classes.

The factory will ensure that the admin view will check if a user is authenticated and has the necessary permissions (as defined by the permission factory).

The factory creates a new class using the provided class as base class and overwrites is_accessible() and inaccessible_callback() methods. Super is called for both methods, so the base class can implement furhter restrictions if needed.

Parameters:base_class (flask_admin.base.BaseView) – Class to use as base class.
Returns:Admin view class which provides authentication and authorization.