codeant-ai-for-open-source[bot] commented on code in PR #42951: URL: https://github.com/apache/superset/pull/42951#discussion_r3746116733
########## docs/admin_docs/security/security.mdx: ########## @@ -198,6 +198,51 @@ Available per-entity overrides are: When an override is set, it replaces `SUBJECTS_RELATED_TYPES` for that picker. When it is `None`, the picker inherits the global default. +#### Looking Up Subjects via API + +Superset exposes a read-only REST API for resolving subjects: + +``` +GET /api/v1/security/subject/ +``` + +The main use case is **id mapping** — given a user, role, or group id, callers (including +extensions) can look up the corresponding subject entity, and vice versa. Access is gated by +the `can_read` permission on the `Subject` resource, which is granted to **Admins only** by +default, since subjects enumerate every user, role, and group on the instance. Non-admins +receive a `403`. Only `GET` (list, get, info) is exposed — there is no create, update, or Review Comment: **Suggestion:** `can_read` on the `Subject` resource is the actual authorization requirement, and administrators can grant that permission to non-admin roles. The statement that all non-admins receive `403` is therefore incorrect; qualify it as the default behavior or state that callers without `can_read` receive `403`. [api mismatch] <details> <summary><b>Severity Level:</b> Major ⚠️</summary> ```mdx - ⚠️ Authorized non-Admin API clients are inaccurately described. - ⚠️ Operators may avoid valid least-privilege role configurations. ``` </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=699b182370ef4b0c8577d4112a7d185e&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=699b182370ef4b0c8577d4112a7d185e&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/admin_docs/security/security.mdx **Line:** 210:213 **Comment:** *Api Mismatch: `can_read` on the `Subject` resource is the actual authorization requirement, and administrators can grant that permission to non-admin roles. The statement that all non-admins receive `403` is therefore incorrect; qualify it as the default behavior or state that callers without `can_read` receive `403`. 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%2F42951&comment_hash=5b53c0fefbd226ff4bc0c9658bd02223aedfbaccd100117a081a706cb90f2410&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42951&comment_hash=5b53c0fefbd226ff4bc0c9658bd02223aedfbaccd100117a081a706cb90f2410&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]
