codeant-ai-for-open-source[bot] commented on code in PR #43900:
URL: https://github.com/apache/superset/pull/43900#discussion_r4078011568


##########
docs/developer_docs/extensions/mcp.md:
##########
@@ -462,6 +462,74 @@ async def metrics_guide(ctx: Context) -> str:
     """
 ```
 
+## Built-in Dashboard Governance Tools
+
+Superset ships three built-in MCP tools for dashboard governance:
+`manage_dashboard_owners`, `manage_dashboard_roles`, and
+`manage_dashboard_certification`. They exist alongside the generic
+`update_dashboard` tool because a few governance fields are unsafe to expose
+as full-replacement lists to an LLM caller โ€” each tool instead takes
+explicit, narrow operations with its own safety semantics.
+
+### `manage_dashboard_owners`
+
+Adds or removes dashboard owners (the USER-type entries in the dashboard's
+Subject-based `editors` list) via `add_owner_ids`/`remove_owner_ids`, never
+a full-replacement list. This guards against the "empty owners" footgun:
+`update_dashboard` intentionally dropped its `owners` field because a
+full-replacement list has no way to prevent an admin from emptying it
+outright.
+
+- **Owner-removal guard**: a request that would leave the dashboard with
+  zero owners is rejected. To transfer ownership, add the new owner in the
+  same call as removing the last existing one.
+- **Self-removal protection**: a non-admin caller who removes themselves is
+  automatically re-added, mirroring the lockout protection
+  `update_dashboard` already relies on (unless an `EXTRA_EDITORS_RESOLVER`
+  is configured). The response's `warnings` reports when this happens.
+- ROLE- or GROUP-type editors already on the dashboard are left untouched.
+- A no-op request (e.g. "adding" an ID that's already an owner) returns an
+  empty `owners` list rather than the full current set, so the tool can't
+  be used as a disguised directory lookup.
+
+### `manage_dashboard_roles`
+
+Adds or removes dashboard access roles (the ROLE-type entries in the
+dashboard's Subject-based `viewers` list) via
+`add_role_ids`/`remove_role_ids`, never a full-replacement list. This
+guards against silently widening or narrowing who can see a dashboard,
+which is why `update_dashboard` dropped its `roles` field.
+
+- **`ENABLE_VIEWERS` reporting**: the response reports the flag's current
+  state via `viewers_enabled` and `warnings` notes when it's disabled โ€” but
+  that warning is informational only. `raise_for_access` enforces a
+  nonempty `viewers` list on a published dashboard regardless of the flag,
+  so a role added here restricts access immediately even with
+  `ENABLE_VIEWERS` off. An empty roles list simply means "no role
+  restriction", i.e. normal permissions apply.

Review Comment:
   **Suggestion:** When USER- or GROUP-type viewers remain, an empty role list 
does not restore normal permissions; the existing viewer subjects still 
restrict dashboard access.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Sometimes` ยท ๐Ÿท๏ธ `Api mismatch`
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
 [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d8f416ba36464434ad8e2fe3125dfa8e&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=d8f416ba36464434ad8e2fe3125dfa8e&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** docs/developer_docs/extensions/mcp.md
   **Line:** 508:509
   **Comment:**
        *Api Mismatch: When USER- or GROUP-type viewers remain, an empty role 
list does not restore normal permissions; the existing viewer subjects still 
restrict dashboard access.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43900&comment_hash=ed442c938f983a0ac636f6446eb723a1c83e9ae474d4c5c8fc50798c77ad8ee5&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43900&comment_hash=ed442c938f983a0ac636f6446eb723a1c83e9ae474d4c5c8fc50798c77ad8ee5&reaction=dislike'>๐Ÿ‘Ž</a>



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