Open davidthewatson opened 11 years ago
Hi @davidthewatson, I know this issue's been open for a long time, but perhaps you can still use some help.
I'd just use the flask-admin's current_user
and create my own admin class inheriting from flask-superadmin's Admin
, e.g. class ProtectedAdmin(Admin)
and override is_accessible
:
from flask.ext.login import current_user
class ProtectedAdmin(Admin):
def is_accessible(self):
return current_user.is_authenticated() # + extra code for permissions
If it's not an issue for you any more, would you consider closing the ticket?
Hi, I'm using flask superadmin and I like what I see. However, I need admin views to be protected. I'm using flask-security with mongoengine. Is there a way that I can get the admin to be protected using the flask-login from flask-security?
The typical method is to use the login_required decorator which can be used directly:
or in class-based views such as:
Thanks!