Description
According to the designs, a scope also applies to the higher levels in the hierarchy. For example:
- A specific course-level scope (course-v1:OpenedX+DemoX+DemoCourse) also applies at the organization level (course-v1:OpenedX+*) and at the platform level (course-v1:*).
- An organization-level scope (course-v1:OpenedX+*) also applies at the platform level (course-v1:*).
Currently the response does not account for this inheritance in either case, so not all scopes that actually apply are being returned.
This also needs to be addressed for library scopes, not just course scopes — the same hierarchy logic (specific library → organization → platform) applies and should be handled consistently with courses.
Expected behavior
When querying any scope (course or library), the response should also include the scopes from all higher levels in the hierarchy that apply to it:
Course → should also include organization and platform.
Library → should also include organization and platform.
Organization → should also include platform.
Current behavior
Only the exact queried scope is returned, without propagating to higher levels in either case.
Context
This came up during a PR review comment
Proposed tasks
- Define the logic to resolve the full scope hierarchy (platform → organization → course/library)
- Update the response to include all applicable higher-level scopes, for any query level
- Ensure the logic is applied consistently to both course scopes and library scopes
- Add tests covering the different hierarchy levels (course→org→platform, library→org→platform, org→platform)
Description
According to the designs, a scope also applies to the higher levels in the hierarchy. For example:
Currently the response does not account for this inheritance in either case, so not all scopes that actually apply are being returned.
This also needs to be addressed for library scopes, not just course scopes — the same hierarchy logic (specific library → organization → platform) applies and should be handled consistently with courses.
Expected behavior
When querying any scope (course or library), the response should also include the scopes from all higher levels in the hierarchy that apply to it:
Course → should also include organization and platform.
Library → should also include organization and platform.
Organization → should also include platform.
Current behavior
Only the exact queried scope is returned, without propagating to higher levels in either case.
Context
This came up during a PR review comment
Proposed tasks