mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-08 21:21:06 +00:00
15 lines
381 B
Python
15 lines
381 B
Python
from flask_admin import AdminIndexView
|
|
from flask_admin.contrib.sqla import ModelView
|
|
from flask_security import current_user
|
|
|
|
|
|
class SecureAdminIndexView(AdminIndexView):
|
|
def is_accessible(self):
|
|
return current_user.has_role("admin")
|
|
|
|
|
|
class SecureModelView(ModelView):
|
|
can_export = True
|
|
|
|
def is_accessible(self):
|
|
return current_user.has_role("admin")
|