bito-code-review[bot] commented on code in PR #36548:
URL: https://github.com/apache/superset/pull/36548#discussion_r2659477995
##########
superset/security/manager.py:
##########
@@ -1205,9 +1259,18 @@ def sync_role_definitions(self) -> None:
self.set_role("sql_lab", self._is_sql_lab_pvm, pvms)
# Configure public role
- if get_conf()["PUBLIC_ROLE_LIKE"]:
+ # If PUBLIC_ROLE_LIKE is "Public", use the built-in Public role with
+ # sensible defaults for anonymous dashboard viewing.
+ # If set to another role name (e.g., "Gamma"), copy permissions from
that role.
+ # If not set (None), the Public role remains empty (default/legacy
behavior).
+ public_role_like = get_conf()["PUBLIC_ROLE_LIKE"]
+ if public_role_like == "Public":
+ # Use the built-in Public role with minimal read-only permissions
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Role Name Inconsistency</b></div>
<div id="fix">
The set_role call uses a hardcoded "Public" string, but to match the
AUTH_ROLE_PUBLIC config (which defaults to "Public" but can be customized), it
should use self.auth_role_public. This ensures consistency, as the copy_role in
the elif branch correctly uses self.auth_role_public.
</div>
</div>
<details>
<summary><b>Citations</b></summary>
<ul>
<li>
Rule Violated: <a
href="https://github.com/apache/superset/blob/cc7c30e/AGENTS.md#L86">AGENTS.md:86</a>
</li>
</ul>
</details>
<small><i>Code Review Run #8f0e3a</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]