Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
b2bffa3b
Commit
b2bffa3b
authored
Aug 28, 2015
by
Paul Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1028 from Kha/patch-1
Docs: Use inaccessible_callback
parents
01589c4c
420b87d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
introduction.rst
doc/introduction.rst
+2
-3
No files found.
doc/introduction.rst
View file @
b2bffa3b
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment