You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2023/01/03 12:15:15 UTC
[GitHub] [superset] dpgaspar commented on a diff in pull request #22566: fix(sqllab): remove link to sqllab if missing perms
dpgaspar commented on code in PR #22566:
URL: https://github.com/apache/superset/pull/22566#discussion_r1060530259
##########
superset/views/core.py:
##########
@@ -2777,6 +2777,13 @@ def _get_sqllab_tabs(user_id: Optional[int]) -> Dict[str, Any]:
@expose("/sqllab/", methods=["GET", "POST"])
def sqllab(self) -> FlaskResponse:
"""SQL Editor"""
+ if not (
+ security_manager.is_admin()
+ or "sql_lab" in (role.name for role in security_manager.get_user_roles())
+ ):
+ flash(__("You do not have access to SQL Lab"), "danger")
+ return redirect("/")
Review Comment:
This probably makes more sense to fix on security manager, where all roles are created
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org