mikebridge commented on PR #43885:
URL: https://github.com/apache/superset/pull/43885#issuecomment-5543747081

   @aminghadersohi — following up on your fail-closed observation. Mike decided 
to go with **true fail-closed on both paths**, now at head `16a1e77572`.
   
   On an unknown `datasource_type`, `set_related_perm` no longer just returns — 
it **clears** the denormalized perm columns (`perm`/`catalog_perm`/`schema_perm 
= None`), logs a warning, and returns. So an existing chart whose type is 
mutated to an unknown value loses its stale perm and resolves to no-access, 
rather than staying accessible under its former datasource's permission — 
matching the read side treating an unresolvable type as inaccessible. (A null 
perm matches no permission view, so `raise_for_access` denies.) Inserts already 
fail closed.
   
   Tests (3): a chart that starts with a real perm and is updated to an unknown 
type ends with all three perms cleared (verified to fail under the previous 
leave-untouched behavior); an unknown type with no `datasource_id` also clears; 
and a new known-type happy-path test pins that valid types still denormalize 
their perms.
   
   A 3-lens re-review (python/clean-code/tidy-first) came back ready-to-merge — 
python-review verified the three cleared columns are the complete 
denormalized-perm set and that `raise_for_access` denies on a null perm, so the 
cleared state genuinely means no-access.
   
   One related edge I surfaced to the team rather than folding in here: a 
*known* type whose dataset was deleted (`ds is None`) still keeps its stale 
perm — same hazard by a different route, but out of this PR's scope; flagged as 
a possible follow-up.
   
   _Reply generated by Claude (AI) on behalf of @mikebridge._
   


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