EnxDev commented on code in PR #44017:
URL: https://github.com/apache/superset/pull/44017#discussion_r4080948428


##########
superset/subjects/utils.py:
##########
@@ -206,7 +206,37 @@ def get_user_subject_ids(user_id: int) -> list[int]:
     1. The user's own USER-type subject
     2. ROLE-type subjects for all direct and group-derived roles the user has
     3. GROUP-type subjects for all groups the user belongs to
+
+    Memoised for the duration of the request, keyed by user id. Authorization
+    calls this once per object checked -- ``is_editor``/``is_viewer`` run it 
for

Review Comment:
   `is_viewer` only reaches here when there's a user id. The embedded guest 
branch falls through to `subjects_from_roles` instead, which runs a query per 
role per resource, so a guest loading a 40-chart dashboard still pays the 
per-chart cost this removes for everyone else.
   
   Not asking you to fix it here, the shape is different enough to want its own 
change. Worth a line in this docstring or a follow-up so the next person 
doesn't read this as covering the guest path too.



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