Skip to content

Migrate openedx-platform imports to openedx_authz.authz #618

Closed
openedx/openedx-platform
#39369

Description

@BryanttV

Description

openedx-authz is organizing its built-in definitions into applets (see #550). As part of that change, the public entry point for the built-in permission and role constants becomes openedx_authz.authz. The old openedx_authz.constants.permissions and openedx_authz.constants.roles modules remain only as compatibility re-exports, and new code is expected to import from openedx_authz.authz.

openedx-platform still imports these constants through the legacy modules, so it depends on a path that is documented as compatibility-only. This issue tracks migrating those imports so that openedx-platform follows the supported API and is not affected if the compatibility modules are later deprecated or removed.

Current Behavior

openedx-platform imports permission and role constants from the legacy modules:

from openedx_authz.constants.permissions import COURSES_VIEW_COURSE
from openedx_authz.constants.roles import COURSE_ADMIN

Expected Behavior

All openedx-platform code, including tests, imports the constants from the supported entry point:

from openedx_authz.authz import COURSE_ADMIN, COURSES_VIEW_COURSE

Acceptance Criteria

  • No module in openedx-platform imports from openedx_authz.constants.permissions or openedx_authz.constants.roles.
  • Imports are written as direct names from openedx_authz.authz, not through module aliases.
  • Code that relied on *_PERMISSIONS lists or on the permissions carried by role constants is updated, for example to use get_permissions_for_single_role.
  • openedx-authz is pinned to a release that exposes openedx_authz.authz, and the requirements files are regenerated.
  • Existing tests pass without behavior changes.

Technical Notes

  • Role constants such as COURSE_ADMIN are RoleData identifiers without a permissions list. Any usage that read their permissions needs to change.
  • The *_PERMISSIONS lists and COURSES_CREATE_COURSE are removed in openedx-authz#550.
  • A grep for openedx_authz.constants over the repository is enough to confirm that no legacy import remains.

Related Issues

Activity

  1. self-assigned this
    on Nov 12, 2026
  2. moved this to Ready for Development in RBAC AuthZ Boardon Nov 12, 2026
  3. moved this from Ready for Development to In Progress in RBAC AuthZ Boardon Nov 12, 2026
  4. moved this from In Progress to Done in RBAC AuthZ Boardon Nov 12, 2026
  5. closed this as completedby moving to Done in RBAC AuthZ Boardon Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions