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


##########
docs/admin_docs/security/security.mdx:
##########
@@ -247,6 +247,33 @@ This feature is particularly useful for:
 - Granting access to dashboards without exposing the underlying datasets for 
other uses
 - Creating dashboard-specific access patterns that don't align with dataset 
permissions
 
+#### Assigning the creator's groups automatically
+
+```python
+ASSIGN_CREATOR_GROUPS_AS_VIEWERS = True
+```
+
+With this enabled, a newly created dashboard or chart is shared read-only with 
every group its
+creator belongs to, unless the create payload names viewers explicitly. It 
applies to every path
+that creates an asset: the REST API, `/dashboard/new/`, save-as from Explore, 
dashboard copy,
+the import commands, and the MCP tools. Datasets are unaffected, as they have 
editors but no
+viewers.
+
+For dashboards, viewer access additionally requires the dashboard to be 
**published** — the same
+rule that governs every dashboard viewer. Until a new dashboard is published 
its creator's groups
+see nothing, and because it now has viewers the dataset-based fallback no 
longer applies to it
+either; group members gain access only once it is published. Charts have no 
such gate, so a new
+chart is visible to the creator's groups immediately.
+
+Note that this **narrows** access rather than widening it. Because an asset 
with no viewers falls

Review Comment:
   With this on, does an alert/report or thumbnail still render for a new chart 
when the executor resolves to a fixed non-admin service account outside the 
creator's groups? Previously `FixedExecutor("svc")` passed `raise_for_access` 
via the no-viewer datasource fallback; once the creator's groups are viewers 
that leg is gone and the service account is neither editor nor viewer.



##########
superset/commands/chart/importers/v1/utils.py:
##########
@@ -201,12 +203,29 @@ def import_chart(
     if chart.id is None:
         db.session.flush()
 
-    if user:
-        from superset.subjects.utils import get_user_subject
+    # Only newly created charts inherit the creator's editor/viewer defaults;
+    # re-importing over an existing chart (overwrite or soft-delete restore)
+    # must not silently grant the importer's groups access. Mirrors the
+    # dashboard importer's ``not existing`` guard.
+    if not existing and user:

Review Comment:
   This guard also drops the *editor* grant on overwrite/restore, which wasn't 
the case before — deliberate, and worth an UPDATING.md line next to the other 
two behavior changes?



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