Commit 420b87d6 authored by Sebastian Ullrich's avatar Sebastian Ullrich

Docs: Use inaccessible_callback

parent 01589c4c
......@@ -125,10 +125,9 @@ could be as simple as::
def is_accessible(self):
return login.current_user.is_authenticated()
def _handle_view(self, name, **kwargs):
def inaccessible_callback(self, name, **kwargs):
# redirect to login page if user doesn't have access
if not self.is_accessible():
return redirect(url_for('login', next=request.url))
return redirect(url_for('login', next=request.url))
In the navigation menu, components that are not accessible to a particular user will not be displayed
for that user. For an example of using Flask-Login with Flask-Admin, have a look
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment