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 2022/05/11 16:52:01 UTC

[GitHub] [superset] michael-s-molina commented on a diff in pull request #19981: feat!: pass datasource_type and datasource_id to form_data

michael-s-molina commented on code in PR #19981:
URL: https://github.com/apache/superset/pull/19981#discussion_r870516884


##########
superset/explore/utils.py:
##########
@@ -24,15 +24,24 @@
     ChartNotFoundError,
 )
 from superset.charts.dao import ChartDAO
+from superset.commands.exceptions import DatasourceNotFoundValidationError
 from superset.datasets.commands.exceptions import (
     DatasetAccessDeniedError,
     DatasetNotFoundError,
 )
 from superset.datasets.dao import DatasetDAO
+from superset.utils.core import DatasourceType
 from superset.views.base import is_user_admin
 from superset.views.utils import is_owner
 
 
+def check_datasource_access(datasource_id: int, datasource_type: str) -> Optional[bool]:
+    if datasource_id:
+        if datasource_type == DatasourceType.TABLE:

Review Comment:
   I'm not sure if `check_dataset_access` depends on the `datasource_type`. Shouldn’t the check occur independently of the data source type?



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