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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to