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/23 23:43:35 UTC

[GitHub] [superset] betodealmeida commented on a change in pull request #17527: fix: RBAC for export for dashboard viewers

betodealmeida commented on a change in pull request #17527:
URL: https://github.com/apache/superset/pull/17527#discussion_r755589793



##########
File path: tests/integration_tests/datasets/api_tests.py
##########
@@ -1382,18 +1380,19 @@ def test_export_dataset_not_found(self):
         rv = self.get_assert_metric(uri, "export")
         assert rv.status_code == 404
 
+    @pytest.mark.usefixtures("create_datasets")
     def test_export_dataset_gamma(self):
         """
         Dataset API: Test export dataset has gamma
         """
-        birth_names_dataset = self.get_birth_names_dataset()
+        dataset = self.get_fixture_datasets()[0]
 
-        argument = [birth_names_dataset.id]
+        argument = [dataset.id]
         uri = f"api/v1/dataset/export/?q={prison.dumps(argument)}"
 
         self.login(username="gamma")
         rv = self.client.get(uri)
-        assert rv.status_code == 404
+        assert rv.status_code == 401

Review comment:
       Can you improve this test, granting `can_export` to gamma and testing that it can export after that?
   
   I think you can do something like `security_manager.add_permission_role("Gamma", "dataset_can_export")` here to add the permission.




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