bito-code-review[bot] commented on code in PR #40650:
URL: https://github.com/apache/superset/pull/40650#discussion_r3337916401
##########
superset/commands/security/create.py:
##########
@@ -50,5 +51,8 @@ def validate(self) -> None:
)
if len(tables) != len(self._tables):
raise DatasourceNotFoundValidationError()
+ for table in tables:
+ if not security_manager.can_access_datasource(datasource=table):
+ raise RLSDatasourceForbiddenError()
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Semantic duplication with update.py</b></div>
<div id="fix">
The authorization loop added at lines 54-56 is identical to the one in
`update.py` lines 63-65. Duplicating this logic creates maintenance risk —
future changes to the validation must be applied in two places, risking
divergence. Extract to a shared helper.
</div>
</div>
<small><i>Code Review Run #e901ab</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]