You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, get_scopes_for_user_and_permission may return a mix of scope types (e.g., CourseOverviewData, OrgCourseOverviewGlobData, and potentially others).
In downstream consumers, we are repeatedly applying additional filtering logic to handle only the relevant scope types (e.g., course-level scopes). This pattern introduces:
Duplicate filtering logic across multiple code paths
Increased risk of edge cases or inconsistencies
Reduced clarity on what the API is expected to return
There is also an upcoming need to handle organization-level scopes separately, which further highlights the importance of clearly separating scope types.
Problem
The current API does not provide a way to filter results by scope type, forcing consumers to:
Be aware of all possible scope types
Implement their own filtering logic
Potentially miss new or unexpected scope types
Proposed Solution
Enhance the get_scopes_for_user_and_permission API to support filtering by scope type.
Activity
rodmgwgu commentedon Apr 8, 2026
Moved this to M2 as it's an improvement not strictly needed for M1
dwong2708 commentedon Apr 13, 2026
After further analysis and implementing the change, I concluded that it is no longer needed.
Reason:
At the time this ticket was created, the Organization-based approach was not yet implemented in the course list process. Now that it is in place, there is no need to add scope filtering.
When calling
get_scopes_for_user_and_permission, we require all scopes returned by the function. For reference, this is where all scopes are used:https://github.com/openedx/openedx-platform/pull/38307/changes#diff-937adee5129f53ead6b3c7c988d70db9e9e95862f17a6f85a1eea2388d12b461R834
However, I’ve created a draft PR in case this functionality is needed in the future:
#258