mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-09-19 18:31:16 +00:00
13 lines
389 B
Python
13 lines
389 B
Python
from flask_admin import AdminIndexView as OldAdminIndexView
|
|
from flask_admin.contrib.sqla import ModelView as OldModelView
|
|
from flask_security import current_user
|
|
|
|
|
|
class AdminIndexView(OldAdminIndexView):
|
|
def is_accessible(self):
|
|
return current_user.has_role("admin")
|
|
|
|
|
|
class ModelView(OldModelView):
|
|
def is_accessible(self):
|
|
return current_user.has_role("admin")
|