From 40ab16f632f57f641564014cea1886c444d9cb34 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Sat, 11 Sep 2021 20:48:14 +0200 Subject: [PATCH] Added SecureAdminBaseView --- advlabdb/customClasses.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/advlabdb/customClasses.py b/advlabdb/customClasses.py index f2fc335..af10a17 100644 --- a/advlabdb/customClasses.py +++ b/advlabdb/customClasses.py @@ -1,5 +1,5 @@ from flask import flash, redirect, request, url_for -from flask_admin import AdminIndexView +from flask_admin import AdminIndexView, BaseView from flask_admin.contrib.sqla import ModelView from flask_security import current_user @@ -102,3 +102,8 @@ class SecureAssistantModelView(CustomModelView): def is_accessible(self): return assistantViewIsAccessible() + + +class SecureAdminBaseView(BaseView): + def is_accessible(self): + return adminViewIsAccessible()