Skip to content

Migrate internal openedx-authz usages of legacy constants imports to openedx_authz.authz #622

Closed

Description

@BryanttV

Description

openedx-authz is reorganizing its built-in permission and role definitions into applets (see #550). The supported import path for these constants is now openedx_authz.authz, while openedx_authz.constants.permissions and openedx_authz.constants.roles remain only as compatibility re-exports. Some code, tests, and documentation inside this repository still reference the legacy paths as if they were the primary entry point. They should follow the same guidance we give to clients so the legacy modules can eventually be deprecated and removed without surprises.

Current Behavior

  • src/openedx_authz/tests/test_migrations.py imports role constants from openedx_authz.constants.roles.
  • src/openedx_authz/tests/test_imports.py imports permissions and roles from openedx_authz.constants and uses module aliases rather than direct names from openedx_authz.authz.
  • Applet READMEs and docs mention the legacy paths in ways that are not always clearly marked as compatibility-only:
    • src/openedx_authz/applets/*/README.rst
    • docs/references/built-in-constants.rst
    • docs/decisions/0032-applets-for-built-in-authorization-capabilities.rst

Expected Behavior

Code and tests in this repository import built-in constants directly by name from openedx_authz.authz. The only intentional references to openedx_authz.constants.permissions and openedx_authz.constants.roles are the compatibility modules themselves, the tests that verify they keep working, and the documentation that explains they are compatibility exports.

Acceptance Criteria

  • No module under src/openedx_authz/ imports from openedx_authz.constants.permissions or openedx_authz.constants.roles, except the compatibility modules themselves and the tests that explicitly verify them.
  • Imports use direct names from openedx_authz.authz, not module aliases.
  • src/openedx_authz/tests/test_migrations.py imports its role constants from openedx_authz.authz.
  • Tests that intentionally cover the legacy paths are clearly labeled as compatibility tests.
  • Applet READMEs and docs consistently describe openedx_authz.authz as the supported path and the legacy modules as compatibility exports.
  • Existing tests pass without behavior changes.

Out of Scope

Related Issues

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