EnxDev commented on code in PR #42472:
URL: https://github.com/apache/superset/pull/42472#discussion_r3658308199


##########
superset/mcp_service/dashboard/tool/generate_dashboard.py:
##########
@@ -347,11 +347,17 @@ def generate_dashboard(  # noqa: C901
                     .first()
                 )
                 if current_user:
-                    from superset.subjects.utils import get_user_subject
+                    from superset.subjects.utils import (
+                        get_default_viewers_for_new_asset,
+                        get_user_subject,
+                    )
 
                     subj = get_user_subject(current_user.id)
                     if subj:
                         dashboard.editors = [subj]
+                    dashboard.viewers = get_default_viewers_for_new_asset(
+                        current_user.id
+                    )

Review Comment:
   No caller-supplied viewers exist to overwrite here. The generate_dashboard 
tool has no viewers input (only the separate manage_dashboard_roles tool 
touches viewers), and the dashboard is built fresh via Dashboard() with nothing 
assigning .viewers before this line. The assignment applies the creator-group 
defaults to an empty collection — equivalent to the create-command behavior — 
rather than replacing an explicit list.



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