-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reimplement has_access decorator. #2028
Conversation
f08f239
to
ccaba31
Compare
ccaba31
to
485303e
Compare
FLAMSG_ERR_SEC_ACCESS_DENIED, | ||
PERMISSION_PREFIX | ||
) | ||
from flask_appbuilder._compat import as_unicode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this? seems like it could bite us in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mistercrunch - I just copied existing implementation:
https://github.com/dpgaspar/Flask-AppBuilder/blob/af095ac4094d068fa2dd467bd01fa8b95d697fc1/flask_appbuilder/security/decorators.py#L5
I plan to create another PR to path FAB is possible, there is a TODO for it.
Has there been anymore progress on this issue? |
xrmx - This solution was not fully implemented in superset. The auth views in flask appbuilder do not take this change into account and they are not implemented in superset. We have implemented oauth login without the user needing to click the login buttons. When this occurs there is a popup to warn the user that Access was denied which is implemented in the has_access method thus forcing us to over write both. Any thought on how to resolve this? |
I moved has_access to utils and extended the redirect upon successful login to provide next arg that can be used by the login implementation to redirect user back to the original path.
I plan to contribute it back to the FAB later on.
Partially solves: #1303
It can be used then in the login implementation
Additional links:
Reviewers: