Skip to content

feat: add FullScopePolicy pass-through scoping policy - #578

Merged
feanil merged 1 commit into
openedx:masterfrom
Abdul-Muqadim-Arbisoft:feat/full-scope-policy
Sep 15, 2026
Merged

feanil merged 1 commit into
openedx:masterfrom
Abdul-Muqadim-Arbisoft:feat/full-scope-policy

Conversation

@Abdul-Muqadim-Arbisoft

Copy link
Copy Markdown
Contributor

Add FullScopePolicy to the scoping module.

The module ships the ScopingPolicy interface and the ScopedQuerysetMixin that applies it, but no concrete policy. A list endpoint whose permission_classes already restrict callers to subjects that may see every row (a platform-admin list, for example) still has to supply a policy to use the mixin, so each such view ends up hand-writing the same pass-through class. This came up in review of openedx/openedx-platform#39037, where the suggestion was a shared "FullScopePolicy" usable in many places; since it is reusable DRF tooling, it belongs here next to the mixin so plugins can use it too.

  • FullScopePolicy — returns the queryset unchanged. Views that need no narrowing set scoping_policy = FullScopePolicy() and stay wired for record-visibility scoping, so a narrower policy can replace it later without touching the view.

Bumps version to 10.9.0 and adds unit tests.

The `scoping` module ships the ScopingPolicy interface and the
ScopedQuerysetMixin that applies it, but no concrete policy. A list
endpoint whose permission_classes already restrict callers to subjects
that may see every row (a platform-admin list, for example) still has to
supply a policy to use the mixin, so each such view ends up hand-writing
the same pass-through class (see openedx-platform#39037 review).

  * FullScopePolicy — returns the queryset unchanged. Views that need no
    narrowing set `scoping_policy = FullScopePolicy()` and stay wired for
    record-visibility scoping, so a narrower policy can replace it later
    without touching the view.

Bumps version to 10.9.0 and adds unit tests.
@feanil
feanil force-pushed the feat/full-scope-policy branch from c1cec2c to 60f25d8 Compare September 15, 2026 16:51
@feanil
feanil enabled auto-merge (rebase) September 15, 2026 16:51
@feanil
feanil merged commit c28050d into openedx:master Sep 15, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants