sha174n commented on code in PR #40333:
URL: https://github.com/apache/superset/pull/40333#discussion_r3293202150


##########
superset/databases/api.py:
##########
@@ -1328,14 +1328,21 @@ def related_objects(self, pk: int) -> Response:
             }
             for chart in data["charts"]
         ]
+        # Filter dashboards to only include those the user can access
+        accessible_dashboards = [
+            dashboard
+            for dashboard in data["dashboards"]
+            if security_manager.can_access_dashboard(dashboard)
+        ]

Review Comment:
   Addressed — charts are now filtered with `security_manager.can_access_chart` 
alongside dashboards.



##########
superset/commands/tag/delete.py:
##########
@@ -85,6 +90,21 @@ def validate(self) -> None:
         if exceptions:
             raise TagInvalidError(exceptions=exceptions)
 
+    def _validate_object_access(
+        self, object_type: ObjectType, object_id: int, exceptions: list[Any]
+    ) -> None:
+        """Validate that the current user has access to the target object."""
+        try:
+            target_object = to_object_model(object_type, object_id)

Review Comment:
   Addressed — `to_object_model` now handles `ObjectType.dataset` 
(lazy-imported `DatasetDAO` to avoid a circular import).



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