Skip to content

Commit

Permalink
Docs: Use inaccessible_callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed Aug 28, 2015
1 parent 01589c4 commit 420b87d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions doc/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 420b87d

Please sign in to comment.