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 2021/11/29 20:58:22 UTC

[GitHub] [superset] etr2460 commented on a change in pull request #16991: fix(QueryContext): validation does not validate query_context metrics

etr2460 commented on a change in pull request #16991:
URL: https://github.com/apache/superset/pull/16991#discussion_r758730334



##########
File path: superset/security/manager.py
##########
@@ -1047,17 +1048,23 @@ def raise_for_access(
 
             assert datasource
 
-            if not (
-                self.can_access_schema(datasource)
-                or self.can_access("datasource_access", datasource.perm or "")
-                or (
-                    feature_flag_manager.is_feature_enabled("DASHBOARD_RBAC")
-                    and self.can_access_based_on_dashboard(datasource)
-                )
-            ):
-                raise SupersetSecurityException(
-                    self.get_datasource_access_error_object(datasource)
-                )
+            self.raise_when_there_is_no_access_to(datasource)
+
+    def raise_when_there_is_no_access_to(self, datasource: BaseDatasource) -> None:

Review comment:
       noting that this pattern was originally used (i think) because it follows the similar one used by the python requests package, `raise_for_status`: https://docs.python-requests.org/en/latest/api/#requests.Response.raise_for_status
   
   @john-bodley might know a bit more about why we picked this naming




-- 
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