Commit b2bffa3b authored by Paul Brown's avatar Paul Brown

Merge pull request #1028 from Kha/patch-1

Docs: Use inaccessible_callback
parents 01589c4c 420b87d6
...@@ -125,10 +125,9 @@ could be as simple as:: ...@@ -125,10 +125,9 @@ could be as simple as::
def is_accessible(self): def is_accessible(self):
return login.current_user.is_authenticated() 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 # 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 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 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