Skip to content

refactor: replace legacy authz policy loading - #1509

Draft
mariajgrimaldi wants to merge 2 commits into
overhangio:releasefrom
mariajgrimaldi:MJG/replace-load-policies
Draft

mariajgrimaldi wants to merge 2 commits into
overhangio:releasefrom
mariajgrimaldi:MJG/replace-load-policies

Conversation

@mariajgrimaldi

@mariajgrimaldi mariajgrimaldi commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

This removes the load_policies calls from the LMS and CMS initialization jobs. Static role-permission policies now come from load_authz_schema, and openedx-authz no longer needs the default policy file that load_policies loaded.

Open PR #1496 adds load_authz_schema while keeping load_policies. We can include this change there instead. If we keep it separate, this PR should be merged after #1496.

This must remain a draft until openedx-platform uses an openedx-authz release that includes load_authz_schema and the removal of authz.policy.

Depends on openedx/openedx-authz#538, which solves openedx/openedx-authz#462.

How to Test

Render and run the LMS and CMS initialization jobs with the new openedx-authz version. Both jobs should run load_authz_schema without calling load_policies.

carlos-marquez-wgu and others added 2 commits September 29, 2026 17:06
Add the load_authz_schema management command to the CMS and LMS
init scripts, right after load_policies within the existing
openedx-authz guard block.

load_policies populates the Casbin policy rows that the authorization
engine uses for permission checks, but those rows carry no display
metadata — no role names, descriptions, permission categories, or
source tracking. load_authz_schema fills that gap: it discovers static
authz schema YAML files contributed by installed applications, validates and
compiles them, and writes the resulting role and permission definitions
to dedicated tables. The API then serves those definitions so frontends
like the Admin Console can display roles and permissions.

The command is idempotent — running it twice with the same schema
produces no duplicate rows and preserves dynamic roles and user
assignments. It must run after migrations (it needs the DB schema)
and before the application serves traffic.

See also:
- openedx/openedx-authz#446
- https://github.com/openedx/openedx-authz/blob/main/docs/decisions/0021-authorization-definition-api.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending Triage

Development

Successfully merging this pull request may close these issues.

2 participants