openedx-authz 4.0.0__tar.gz → 4.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/CHANGELOG.rst +5 -0
  2. {openedx_authz-4.0.0/src/openedx_authz.egg-info → openedx_authz-4.2.0}/PKG-INFO +1 -1
  3. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0012-auditability.rst +9 -0
  4. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0018-authorization-schema-lifecycle.rst +16 -1
  5. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0023-extend-static-roles.rst +11 -0
  6. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0025-authorization-schema-source-tracking.rst +17 -0
  7. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0028-api-contract-for-role-catalog.rst +23 -0
  8. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0034-permission-dependencies-in-authorization-schema.rst +7 -0
  9. openedx_authz-4.2.0/docs/decisions/0035-custom-role-persistence.rst +205 -0
  10. openedx_authz-4.2.0/docs/decisions/0036-api-contract-for-custom-roles.rst +312 -0
  11. openedx_authz-4.2.0/docs/decisions/0037-custom-role-audit-trail.rst +147 -0
  12. openedx_authz-4.2.0/docs/decisions/0038-hidden-permission-categories-and-permissions.rst +119 -0
  13. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/references/authorization-schema-json.rst +6 -0
  14. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/references/authorization-schema.rst +6 -0
  15. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/references/compiled-schema.yaml +116 -48
  16. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/api/catalog.py +12 -7
  17. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/course_authoring/schema/permissions.yaml +29 -32
  18. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/course_team_roles/schema/legacy_permissions.yaml +1 -0
  19. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/enrollments/schema/permissions.yaml +1 -1
  20. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/learner_administration/schema/permissions.yaml +8 -12
  21. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/learner_grading/schema/permissions.yaml +1 -1
  22. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/renderer.py +4 -0
  23. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/authz-schema-v1.json +14 -0
  24. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/loading.py +2 -0
  25. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/types/definitions.py +11 -1
  26. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/utils.py +1 -1
  27. openedx_authz-4.2.0/src/openedx_authz/migrations/0013_add_hidden_to_categories_and_permissions.py +22 -0
  28. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/models/schema.py +17 -2
  29. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/admin_console/views.py +14 -11
  30. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/permissions.py +1 -1
  31. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/views.py +12 -6
  32. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/api/test_catalog.py +51 -1
  33. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/api/test_data.py +17 -12
  34. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/api/test_roles.py +180 -165
  35. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/api/test_users.py +89 -70
  36. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/applets/test_builtin_definitions.py +26 -13
  37. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/applets/test_instructor_dashboard_permissions.py +15 -9
  38. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/rest_api/admin_console/test_views.py +69 -58
  39. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/rest_api/mixins.py +15 -11
  40. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/rest_api/test_views.py +116 -103
  41. openedx_authz-4.2.0/src/openedx_authz/tests/role_permissions.py +180 -0
  42. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/factories.py +2 -0
  43. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_apply.py +27 -0
  44. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_loading.py +13 -1
  45. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_snapshot.py +2 -0
  46. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_source_storage.py +22 -0
  47. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_syntax.py +10 -0
  48. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/test_commands.py +2 -2
  49. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/test_enforcement.py +22 -23
  50. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/test_engine_utils.py +46 -38
  51. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/test_migrations.py +1 -1
  52. {openedx_authz-4.0.0 → openedx_authz-4.2.0/src/openedx_authz.egg-info}/PKG-INFO +1 -1
  53. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz.egg-info/SOURCES.txt +5 -0
  54. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz.egg-info/scm_file_list.json +5 -0
  55. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/uv.lock +246 -246
  56. openedx_authz-4.0.0/src/openedx_authz/tests/role_permissions.py +0 -121
  57. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.annotation_safe_list.yml +0 -0
  58. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.editorconfig +0 -0
  59. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  60. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.github/dependabot.yml +0 -0
  61. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.github/workflows/add-depr-ticket-to-depr-board.yml +0 -0
  62. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.github/workflows/add-remove-label-on-comment.yml +0 -0
  63. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.github/workflows/ci.yml +0 -0
  64. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.github/workflows/commitlint.yml +0 -0
  65. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.github/workflows/release.yml +0 -0
  66. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.github/workflows/self-assign-issue.yml +0 -0
  67. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.github/workflows/upgrade-python-requirements.yml +0 -0
  68. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.gitignore +0 -0
  69. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.pii_annotations.yml +0 -0
  70. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/.readthedocs.yaml +0 -0
  71. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/LICENSE +0 -0
  72. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/MANIFEST.in +0 -0
  73. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/Makefile +0 -0
  74. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/README.rst +0 -0
  75. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/catalog-info.yaml +0 -0
  76. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/codecov.yml +0 -0
  77. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/Makefile +0 -0
  78. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/_images/architecture-overview.png +0 -0
  79. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/_static/theme_overrides.css +0 -0
  80. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/changelog.rst +0 -0
  81. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/concepts/core_roles_and_permissions/content_library_roles.rst +0 -0
  82. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/concepts/core_roles_and_permissions/course_roles.rst +0 -0
  83. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/concepts/core_roles_and_permissions/index.rst +0 -0
  84. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/concepts/index.rst +0 -0
  85. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/conf.py +0 -0
  86. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0001-purpose-of-this-repo.rst +0 -0
  87. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0002-authorization-model-foundation.rst +0 -0
  88. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0003-jwt-usage.rst +0 -0
  89. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0004-technology-selection.rst +0 -0
  90. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0005-architecture-and-data-modeling.rst +0 -0
  91. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0007-enforcement-mechanisms-mfe.rst +0 -0
  92. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0008-compatibility-scheme.rst +0 -0
  93. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0009-authz-for-course-authoring.rst +0 -0
  94. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0010-course-authoring-flag.rst +0 -0
  95. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0011-course-authoring-migration-process.rst +0 -0
  96. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0012-glob-support-for-role-assignments.rst +0 -0
  97. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0013-course-authoring-automatic-migration.rst +0 -0
  98. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0014-bulk-assignment-queries-without-casbin-enforce.rst +0 -0
  99. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0015-expose-course-authoring-waffle-flag-state-via-rest-api.rst +0 -0
  100. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0016-static-and-dynamic-roles.rst +0 -0
  101. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0017-static-authorization-schema.rst +0 -0
  102. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0019-authorization-schema-discovery.rst +0 -0
  103. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0020-authorization-schema-internationalization.rst +0 -0
  104. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0021-authorization-definition-api.rst +0 -0
  105. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0022-defer-authorization-implications.rst +0 -0
  106. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0024-api-contract-for-user-grouped-role-assignments.rst +0 -0
  107. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0026-rest-api-domain-ownership-boundary.rst +0 -0
  108. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0027-cross-domain-filtering-via-openedx-filters.rst +0 -0
  109. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0029-paragon-icon-list-maintenance.rst +0 -0
  110. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0030-tutor-implementation-authz-schema-discovery.rst +0 -0
  111. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0031-priority-applies-to-role-extensions-only.rst +0 -0
  112. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0032-applets-for-built-in-authorization-capabilities.rst +0 -0
  113. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/0033-shared-applet-for-course-team-roles.rst +0 -0
  114. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions/README.rst +0 -0
  115. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/decisions.rst +0 -0
  116. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/getting_started.rst +0 -0
  117. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/how-tos/index.rst +0 -0
  118. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/how-tos/use-built-in-constants.rst +0 -0
  119. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/index.rst +0 -0
  120. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/internationalization.rst +0 -0
  121. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/make.bat +0 -0
  122. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/quickstarts/index.rst +0 -0
  123. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/readme.rst +0 -0
  124. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/references/built-in-constants.rst +0 -0
  125. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/references/compiled-schema.rst +0 -0
  126. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/references/index.rst +0 -0
  127. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/docs/testing.rst +0 -0
  128. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/manage.py +0 -0
  129. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/pylintrc +0 -0
  130. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/pylintrc_tweaks +0 -0
  131. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/pyproject.toml +0 -0
  132. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/ruff.toml +0 -0
  133. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/scripts/generate_compiled_schema.py +0 -0
  134. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/scripts/generate_paragon_icons.py +0 -0
  135. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/setup.cfg +0 -0
  136. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/__init__.py +0 -0
  137. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/admin.py +0 -0
  138. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/api/__init__.py +0 -0
  139. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/api/data.py +0 -0
  140. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/api/permissions.py +0 -0
  141. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/api/roles.py +0 -0
  142. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/api/users.py +0 -0
  143. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/api/utils.py +0 -0
  144. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/__init__.py +0 -0
  145. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/content_libraries/README.rst +0 -0
  146. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/content_libraries/__init__.py +0 -0
  147. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/content_libraries/constants.py +0 -0
  148. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/content_libraries/schema/permissions.yaml +0 -0
  149. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/content_libraries/schema/roles.yaml +0 -0
  150. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/course_authoring/README.rst +0 -0
  151. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/course_authoring/__init__.py +0 -0
  152. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/course_authoring/constants.py +0 -0
  153. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/course_authoring/schema/role_extensions.yaml +0 -0
  154. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/course_team_roles/README.rst +0 -0
  155. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/course_team_roles/__init__.py +0 -0
  156. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/course_team_roles/constants.py +0 -0
  157. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/course_team_roles/schema/roles.yaml +0 -0
  158. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/enrollments/README.rst +0 -0
  159. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/enrollments/__init__.py +0 -0
  160. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/enrollments/constants.py +0 -0
  161. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/enrollments/schema/role_extensions.yaml +0 -0
  162. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/learner_administration/README.rst +0 -0
  163. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/learner_administration/__init__.py +0 -0
  164. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/learner_administration/constants.py +0 -0
  165. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/learner_administration/schema/role_extensions.yaml +0 -0
  166. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/learner_grading/README.rst +0 -0
  167. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/learner_grading/__init__.py +0 -0
  168. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/learner_grading/constants.py +0 -0
  169. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/applets/learner_grading/schema/role_extensions.yaml +0 -0
  170. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/apps.py +0 -0
  171. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/authz/__init__.py +0 -0
  172. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/conf/locale/config.yaml +0 -0
  173. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/constants/__init__.py +0 -0
  174. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/constants/permissions.py +0 -0
  175. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/constants/roles.py +0 -0
  176. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/constants/schema.py +0 -0
  177. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/data.py +0 -0
  178. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/__init__.py +0 -0
  179. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/adapter.py +0 -0
  180. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/apps.py +0 -0
  181. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/config/model.conf +0 -0
  182. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/enforcer.py +0 -0
  183. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/filter.py +0 -0
  184. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/matcher.py +0 -0
  185. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/policy.py +0 -0
  186. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/__init__.py +0 -0
  187. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/compilation.py +0 -0
  188. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/discovery.py +0 -0
  189. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/exceptions.py +0 -0
  190. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/issues.py +0 -0
  191. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/paragon_icons.py +0 -0
  192. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/parsing.py +0 -0
  193. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/pipeline.py +0 -0
  194. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/snapshot.py +0 -0
  195. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/syntax.py +0 -0
  196. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/translation.py +0 -0
  197. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/types/__init__.py +0 -0
  198. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/types/compilation.py +0 -0
  199. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/types/loading.py +0 -0
  200. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/engine/schema/validation.py +0 -0
  201. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/filters.py +0 -0
  202. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/handlers.py +0 -0
  203. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/management/__init__.py +0 -0
  204. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/management/commands/__init__.py +0 -0
  205. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/management/commands/authz_migrate_course_authoring.py +0 -0
  206. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/management/commands/authz_rollback_course_authoring.py +0 -0
  207. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/management/commands/enforcement.py +0 -0
  208. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/management/commands/extract_schema_translations.py +0 -0
  209. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/management/commands/load_authz_schema.py +0 -0
  210. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/management/commands/load_policies.py +0 -0
  211. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/0001_add_casbin_dependency.py +0 -0
  212. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/0002_initial.py +0 -0
  213. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/0003_usersubject.py +0 -0
  214. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/0004_contentlibraryscope.py +0 -0
  215. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/0005_policycachecontrol.py +0 -0
  216. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/0006_migrate_legacy_permissions.py +0 -0
  217. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/0007_coursescope.py +0 -0
  218. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/0008_authzcourseauthoringmigrationrun.py +0 -0
  219. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/0009_roleassignmentaudit.py +0 -0
  220. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/0010_scope_external_key.py +0 -0
  221. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/0011_authz_schema_definitions.py +0 -0
  222. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/0012_move_builtin_schema_sources_to_applets.py +0 -0
  223. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/migrations/__init__.py +0 -0
  224. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/models/__init__.py +0 -0
  225. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/models/authz_migration.py +0 -0
  226. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/models/base.py +0 -0
  227. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/models/core.py +0 -0
  228. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/models/engine.py +0 -0
  229. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/models/scopes.py +0 -0
  230. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/models/subjects.py +0 -0
  231. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/__init__.py +0 -0
  232. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/data.py +0 -0
  233. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/decorators.py +0 -0
  234. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/urls.py +0 -0
  235. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/utils.py +0 -0
  236. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/__init__.py +0 -0
  237. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/admin_console/__init__.py +0 -0
  238. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/admin_console/filters.py +0 -0
  239. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/admin_console/serializers.py +0 -0
  240. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/course_authoring/__init__.py +0 -0
  241. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/course_authoring/pipeline.py +0 -0
  242. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/course_authoring/views.py +0 -0
  243. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/fields.py +0 -0
  244. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/paginators.py +0 -0
  245. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/serializers.py +0 -0
  246. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/rest_api/v1/urls.py +0 -0
  247. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/settings/__init__.py +0 -0
  248. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/settings/common.py +0 -0
  249. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/settings/production.py +0 -0
  250. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/settings/test.py +0 -0
  251. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/templates/openedx_authz/base.html +0 -0
  252. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/__init__.py +0 -0
  253. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/api/__init__.py +0 -0
  254. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/applets/__init__.py +0 -0
  255. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/authz/__init__.py +0 -0
  256. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/authz/test_resources.py +0 -0
  257. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/__init__.py +0 -0
  258. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/conftest.py +0 -0
  259. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_compiled/categories.yaml +0 -0
  260. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_compiled/extensions.yaml +0 -0
  261. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_compiled/permissions.yaml +0 -0
  262. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_compiled/roles.yaml +0 -0
  263. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_parse/malformed.yaml +0 -0
  264. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_semantics/unknown_category.yaml +0 -0
  265. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_structure/items.yml +0 -0
  266. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_structure/priority.yaml +0 -0
  267. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/valid/categories.yaml +0 -0
  268. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/valid/extensions.yaml +0 -0
  269. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/valid/permissions.yml +0 -0
  270. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/valid/roles.yaml +0 -0
  271. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/test_handlers.py +0 -0
  272. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/test_models.py +0 -0
  273. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/test_schema_apply.py +0 -0
  274. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/test_schema_pipeline.py +0 -0
  275. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/integration/test_views.py +0 -0
  276. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/rest_api/__init__.py +0 -0
  277. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/rest_api/admin_console/__init__.py +0 -0
  278. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/rest_api/course_authoring/__init__.py +0 -0
  279. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/rest_api/course_authoring/test_pipeline.py +0 -0
  280. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/rest_api/course_authoring/test_views.py +0 -0
  281. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/rest_api/test_permissions.py +0 -0
  282. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/rest_api/test_utils.py +0 -0
  283. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/__init__.py +0 -0
  284. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_compilation.py +0 -0
  285. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_discovery.py +0 -0
  286. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_json_schema.py +0 -0
  287. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_load_authz_schema_command.py +0 -0
  288. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_parsing.py +0 -0
  289. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_pipeline.py +0 -0
  290. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_renderer.py +0 -0
  291. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_schema_models.py +0 -0
  292. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_translation.py +0 -0
  293. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_types.py +0 -0
  294. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/schema/test_validation.py +0 -0
  295. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/stubs/__init__.py +0 -0
  296. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/stubs/apps.py +0 -0
  297. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/stubs/migrations/0001_initial.py +0 -0
  298. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/stubs/migrations/0002_learningpackage_contentlibrary_learning_package.py +0 -0
  299. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/stubs/migrations/0002_userprofile.py +0 -0
  300. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/stubs/models.py +0 -0
  301. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/test_enforcer.py +0 -0
  302. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/test_filter.py +0 -0
  303. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/test_handlers.py +0 -0
  304. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/test_imports.py +0 -0
  305. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/test_models.py +0 -0
  306. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/test_policy.py +0 -0
  307. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/tests/test_utils.py +0 -0
  308. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/urls.py +0 -0
  309. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz/utils.py +0 -0
  310. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz.egg-info/dependency_links.txt +0 -0
  311. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz.egg-info/entry_points.txt +0 -0
  312. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz.egg-info/requires.txt +0 -0
  313. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/src/openedx_authz.egg-info/top_level.txt +0 -0
  314. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/tox.ini +0 -0
  315. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/tutor/tutor-contrib-authz/.gitignore +0 -0
  316. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/tutor/tutor-contrib-authz/LICENSE.txt +0 -0
  317. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/tutor/tutor-contrib-authz/MANIFEST.in +0 -0
  318. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/tutor/tutor-contrib-authz/Makefile +0 -0
  319. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/tutor/tutor-contrib-authz/README.rst +0 -0
  320. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/tutor/tutor-contrib-authz/pyproject.toml +0 -0
  321. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/tutor/tutor-contrib-authz/tutor_authz/__about__.py +0 -0
  322. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/tutor/tutor-contrib-authz/tutor_authz/__init__.py +0 -0
  323. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/tutor/tutor-contrib-authz/tutor_authz/patches/openedx-common-settings +0 -0
  324. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/tutor/tutor-contrib-authz/tutor_authz/plugin.py +0 -0
  325. {openedx_authz-4.0.0 → openedx_authz-4.2.0}/tutor/tutor-contrib-authz/tutor_authz/templates/apps/openedx/config/authz-schema.yml +0 -0
@@ -17,6 +17,10 @@ Unreleased
17
17
  Added
18
18
  =====
19
19
 
20
+ * Added an optional ``hidden`` flag to permission categories and permissions in the authorization
21
+ schema. Hidden permissions, and the permissions of hidden categories, are left out of the
22
+ role and permission catalog, including each role's permission list, but keep their role grants
23
+ and permission checks.
20
24
  * Added the static authorization schema, a versioned YAML format for declaring permissions,
21
25
  permission categories, roles, and role extensions (ADR 0017). The permissions and roles
22
26
  previously defined in ``authz.policy`` are expressed as schema files under
@@ -56,6 +60,7 @@ Added
56
60
  Changed
57
61
  ========
58
62
 
63
+ * Updated the course permission categories and permissions to match the Roles and Permissions console proposal. ``View course info`` and ``View checklists`` move to ``Course access & content``, ``Export tags`` moves to ``Tags``, and the group configuration permissions move to ``Cohorts & content groups``. The ``course_information`` and ``course_other`` categories are removed. ``Course team & groups``, ``Grading``, ``Advanced & certificates``, and ``Import / export`` are renamed, the category IDs ``course_cohorts``, ``course_team_group``, ``course_grading``, and ``course_advanced_certificates`` become ``course_cohorts_content_groups``, ``course_team``, ``course_grading_settings``, and ``course_advanced_settings_certificates``, and several category and permission descriptions now name Studio and the Instructor Dashboard. ``courses.manage_taxonomies`` is now hidden. Role grants are unchanged.
59
64
  * Static roles may declare an empty permission list when ``role_extensions`` contribute their permissions. Permission lists used by extension edits remain non-empty.
60
65
  * Built-in Content Library and course authorization definitions now live in capability applets. The compiled authorization schema, the permission constants, and the role keys remain unchanged.
61
66
  * **Breaking**: ``GET /api/authz/v1/scopes/`` no longer accepts ``course`` and ``library`` as
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openedx-authz
3
- Version: 4.0.0
3
+ Version: 4.2.0
4
4
  Summary: Open edX AuthZ provides the architecture and foundations of the authorization framework.
5
5
  Author-email: Open edX Project <oscm@openedx.org>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -188,6 +188,13 @@ Rejected for three reasons:
188
188
  ``django-simple-history`` remains the right tool for Option B (point-in-time state
189
189
  reconstruction), where it is a snapshot mechanism, not an operation log.
190
190
 
191
+ Addendum (2026-11-09)
192
+ *********************
193
+
194
+ `ADR 0037`_ records custom role changes in a separate ``RoleDefinitionAudit`` table and adds a
195
+ nullable ``role_change_id`` to ``RoleAssignmentAudit`` and the assignment event data. It links
196
+ assignments deleted by removing a role to that role change.
197
+
191
198
  References
192
199
  **********
193
200
 
@@ -199,10 +206,12 @@ References
199
206
  - `django-simple-history documentation`_
200
207
  - `django-crum documentation`_
201
208
  - `OEPM-Spike: RBAC AuthZ Auditability`_
209
+ - `ADR 0037`_
202
210
 
203
211
  .. _ADR 0002: https://github.com/openedx/openedx-authz/blob/main/docs/decisions/0002-authorization-model-foundation.rst
204
212
  .. _ADR 0004: https://github.com/openedx/openedx-authz/blob/main/docs/decisions/0004-technology-selection.rst
205
213
  .. _ADR 0005: https://github.com/openedx/openedx-authz/blob/main/docs/decisions/0005-architecture-and-data-modeling.rst
214
+ .. _ADR 0037: 0037-custom-role-audit-trail.rst
206
215
  .. _Auth0 FGA Logging API: https://auth0.com/blog/auth0-fga-logging-api-a-complete-audit-trail-for-authorization/
207
216
  .. _SpiceDB: https://github.com/authzed/spicedb
208
217
  .. _OpenFGA: https://openfga.dev/
@@ -126,13 +126,27 @@ Compile, render, apply, and consume keep the responsibilities defined above. Typ
126
126
 
127
127
  The separation adds an intermediate parsed-document representation and another explicit pipeline boundary. Callers that previously treated loading as both YAML parsing and typed construction must use the corresponding phase for the representation they need.
128
128
 
129
+ Addendum: Reserved prefix replaces runtime role name conflicts
130
+ ==============================================================
131
+
132
+ **2026-11-12**
133
+
134
+ `ADR 0035`_ sets the naming rule for dynamic roles that section 4 left out of scope. Custom (dynamic) role IDs use the reserved ``custom_`` prefix, and schema validation rejects static role IDs that start with it.
135
+
136
+ As a result, a static role and a custom role can no longer share a name. The following parts of section 4 no longer apply:
137
+
138
+ * The dynamic role API does not need to reject names used by static roles.
139
+ * Deployment does not stop because a new static role conflicts with an existing dynamic role. A static role ID that starts with ``custom_`` fails schema validation instead, before any database change.
140
+
141
+ Static and dynamic roles still share one set of role IDs, and uniqueness among dynamic roles is still enforced when they are created.
142
+
129
143
  Consequences
130
144
  ************
131
145
 
132
146
  * Deployment compiles the schema before the application begins serving requests for reliability and performance.
133
147
  * Repeating a deployment creates no duplicate rows and preserves data owned by runtime services.
134
148
  * The schema loader, dynamic role API, and assignment API can update only the rows they own.
135
- * Role identifier conflicts are reported before either definition is changed.
149
+ * Role identifier conflicts are reported before either definition is changed. Conflicts between static and dynamic roles are prevented by the reserved ``custom_`` prefix (see the addendum on `ADR 0035`_).
136
150
  * Applying a schema requires a database transaction or another mechanism that updates all generated rows together.
137
151
  * Operators receive the change report before the database is updated.
138
152
  * An assignment to a role being removed blocks deployment unless an operator explicitly removes the role and its assignments together.
@@ -146,3 +160,4 @@ References
146
160
 
147
161
  .. _ADR 0016: 0016-static-and-dynamic-roles.rst
148
162
  .. _ADR 0017: 0017-static-authorization-schema.rst
163
+ .. _ADR 0035: 0035-custom-role-persistence.rst
@@ -135,6 +135,17 @@ References
135
135
  * :ref:`Authorization Schema Reference`
136
136
  * `Tutor plugin development`_
137
137
 
138
+ Addendum: 2026-11-16
139
+ ********************
140
+
141
+ Permission categories and permissions also accept an optional ``hidden`` flag in their base definitions, with the same effect as for roles. A hidden permission is omitted from normal discovery APIs and from role details, and a hidden category omits all of its permissions. Hiding does not delete the definition, remove the permission from roles, or change permission checks.
142
+
143
+ Role extensions cannot change this flag. They only change roles, so ``hidden`` on categories and permissions is set only where they are defined (`ADR 0028`_).
144
+
145
+ This addendum extends "Hiding a role" and does not change the role extension fields described earlier in this decision. See `ADR 0038`_.
146
+
147
+ .. _ADR 0028: 0028-api-contract-for-role-catalog.rst
148
+ .. _ADR 0038: 0038-hidden-permission-categories-and-permissions.rst
138
149
  .. _ADR 0017: 0017-static-authorization-schema.rst
139
150
  .. _ADR 0018: 0018-authorization-schema-lifecycle.rst
140
151
  .. _ADR 0019: 0019-authorization-schema-discovery.rst
@@ -215,6 +215,19 @@ Consequences
215
215
  * Compilation must track provenance at the role-permission grain, and the apply step writes the
216
216
  definition, relationship, and source tables in the same transaction as the policy rows.
217
217
 
218
+ Addendum (2026-11-05)
219
+ *********************
220
+
221
+ `ADR 0035`_ stores custom (dynamic) roles in the role-definition and role-permission tables
222
+ defined here. Custom roles have no source links, and the schema loader does not prune them. See
223
+ that ADR for how deployments treat custom roles.
224
+
225
+ Addendum (2026-11-09)
226
+ *********************
227
+
228
+ `ADR 0037`_ records who created each custom (dynamic) role, and when, in its ``created`` audit
229
+ record.
230
+
218
231
  References
219
232
  **********
220
233
 
@@ -223,9 +236,13 @@ References
223
236
  * `ADR 0019`_
224
237
  * `ADR 0021`_
225
238
  * `ADR 0023`_
239
+ * `ADR 0035`_
240
+ * `ADR 0037`_
226
241
 
227
242
  .. _ADR 0017: 0017-static-authorization-schema.rst
228
243
  .. _ADR 0018: 0018-authorization-schema-lifecycle.rst
229
244
  .. _ADR 0019: 0019-authorization-schema-discovery.rst
230
245
  .. _ADR 0021: 0021-authorization-definition-api.rst
231
246
  .. _ADR 0023: 0023-extend-static-roles.rst
247
+ .. _ADR 0035: 0035-custom-role-persistence.rst
248
+ .. _ADR 0037: 0037-custom-role-audit-trail.rst
@@ -399,6 +399,20 @@ Separate permission and category endpoints
399
399
 
400
400
  The Admin Console would need several requests and would have to join the data itself.
401
401
 
402
+ Addendum: 2026-11-05
403
+ ********************
404
+
405
+ `ADR 0036`_ changes this endpoint for the Custom Roles table:
406
+
407
+ * Each role adds ``user_count`` (brought back, now that the table shows it) and ``updated_at``.
408
+ * The query adds ``definition_kind`` (``static`` or ``user_defined``), ``search``, ``sort_by``
409
+ and ``order``.
410
+ * Custom roles with no permissions are still listed, with ``scope_types`` taken from the role's
411
+ stored resource type instead of its grants. Removed custom roles are not listed.
412
+ * Filtering, search, sorting and pagination run in Python over the roles of the requested scope types,
413
+ instead of in a single database query, so translated static role names are searched and
414
+ sorted as the user sees them.
415
+
402
416
  References
403
417
  **********
404
418
 
@@ -416,11 +430,20 @@ The deprecated ``course`` and ``library`` aliases of ``GET /api/authz/v1/scopes/
416
430
 
417
431
  This addendum replaces the alias bullets in "Scope type naming" and the mention of the aliases in the consequences.
418
432
 
433
+ Addendum: 2026-11-16
434
+ ********************
435
+
436
+ Permission categories and permissions have an optional ``hidden`` flag (`ADR 0023`_). The catalog leaves out hidden permissions and permissions in hidden categories, and each role's ``permissions`` omits them too. ``categories`` contains only non-hidden categories used by the remaining permissions. Roles are still listed by their grants in the requested scope types, so a role whose permissions are all hidden is returned with an empty ``permissions`` list. The grants themselves are kept and permission checks do not change.
437
+
438
+ This addendum amends the ``permissions``, ``roles`` and ``categories`` bullets of the response rules above. See `ADR 0038`_.
439
+
419
440
  .. _frontend-app-admin-console: https://github.com/openedx/frontend-app-admin-console
420
441
  .. _Issue #536: https://github.com/openedx/openedx-authz/issues/536
442
+ .. _ADR 0038: 0038-hidden-permission-categories-and-permissions.rst
421
443
  .. _ADR 0020: 0020-authorization-schema-internationalization.rst
422
444
  .. _ADR 0021: 0021-authorization-definition-api.rst
423
445
  .. _ADR 0023: 0023-extend-static-roles.rst
424
446
  .. _ADR 0024: 0024-api-contract-for-user-grouped-role-assignments.rst
425
447
  .. _ADR 0025: 0025-authorization-schema-source-tracking.rst
426
448
  .. _ADR 0029: 0029-paragon-icon-list-maintenance.rst
449
+ .. _ADR 0036: 0036-api-contract-for-custom-roles.rst
@@ -118,6 +118,11 @@ Consequences
118
118
  * Tests check the validation rules and confirm that enforcement results match the explicit role permissions.
119
119
  * The Custom Roles API should apply the same role rule to roles that users create.
120
120
 
121
+ Addendum: Indirect Dependencies in the Catalog (2026-11-17)
122
+ ===========================================================
123
+
124
+ `ADR 0036`_ adds ``all_depends_on`` to each permission in the role catalog, next to ``depends_on``. It lists every direct and indirect dependency, so clients no longer compute indirect dependencies themselves. This replaces the last part of section 6.
125
+
121
126
  Rejected Alternatives
122
127
  *********************
123
128
 
@@ -145,6 +150,7 @@ References
145
150
  * `ADR 0025`_
146
151
  * `ADR 0028`_
147
152
  * `ADR 0031`_
153
+ * `ADR 0036`_
148
154
  * `Issue #91`_
149
155
  * `Issue #523`_
150
156
  * `PR #538`_
@@ -156,6 +162,7 @@ References
156
162
  .. _ADR 0025: 0025-authorization-schema-source-tracking.rst
157
163
  .. _ADR 0028: 0028-api-contract-for-role-catalog.rst
158
164
  .. _ADR 0031: 0031-priority-applies-to-role-extensions-only.rst
165
+ .. _ADR 0036: 0036-api-contract-for-custom-roles.rst
159
166
  .. _Issue #91: https://github.com/openedx/openedx-authz/issues/91
160
167
  .. _Issue #523: https://github.com/openedx/openedx-authz/issues/523
161
168
  .. _PR #538: https://github.com/openedx/openedx-authz/pull/538
@@ -0,0 +1,205 @@
1
+ 0035: Persist Custom Roles in the Authorization Definition Tables
2
+ #################################################################
3
+
4
+ Status
5
+ ******
6
+
7
+ **Draft**
8
+
9
+ Context
10
+ *******
11
+
12
+ Administrators need roles that match their organization, beyond the roles that ship with the
13
+ platform. Administrators create, copy, edit, and remove these custom roles from the
14
+ Administrative Console. A custom role has a name, a description, one resource type (courses or
15
+ libraries), and a set of existing permissions. Roles that ship with the platform stay read-only and
16
+ are customized by copying them.
17
+
18
+ Custom roles are the dynamic roles of `ADR 0016`_, which requires the authz model to store their
19
+ definitions. `ADR 0018`_ requires static and custom roles to share one set of role IDs and the
20
+ schema loader to preserve custom roles, but does not say where custom roles are stored.
21
+
22
+ `ADR 0025`_ added tables for compiled static definitions: categories, permissions, roles, and
23
+ role-permission grants, each linked to the module that contributed it. The role catalog
24
+ (`ADR 0028`_) reads roles from these tables and already reserves a ``definition_kind`` field with the
25
+ values ``static`` and ``user_defined``. Today, a schema deployment deletes every role and grant in
26
+ these tables that the compiled schema does not declare, so it would delete custom roles.
27
+
28
+ Decision
29
+ ********
30
+
31
+ 1. Store custom roles in the definition tables
32
+ ==============================================
33
+
34
+ A custom role is a row in the role-definition table, and each permission it grants is a row in the
35
+ role-permission table, the same as for a static role. The role row records its definition kind,
36
+ ``static`` or ``user_defined``, matching `ADR 0028`_. The kind never changes after creation.
37
+
38
+ A custom role has no source links, because no module contributed it, unlike the static definitions
39
+ that `ADR 0025`_ attributes to a source. Its grants need no separate kind flag: static roles cannot
40
+ be edited through the API, so a grant is user-defined exactly when the role that owns it is.
41
+
42
+ Custom roles only reference existing permissions. They do not create permissions or categories,
43
+ which stay static.
44
+
45
+ Custom roles are never hidden: their ``hidden`` flag is always false. Hiding a role (`ADR 0023`_) is
46
+ a schema extension that applies to static roles when the schema loads. A custom role that is no
47
+ longer needed is removed instead (section 4).
48
+
49
+ 2. Identity and display fields
50
+ ==============================
51
+
52
+ Custom roles are global to the instance. Their IDs use the reserved prefix ``custom_`` followed by
53
+ the display name converted to the role ID format (``[a-z][a-z0-9_]*``). The ID is set at creation and
54
+ never changes, so renaming a role does not affect its assignments or policy rows.
55
+
56
+ The name is converted with the Python standard library, so no transliteration dependency is needed:
57
+
58
+ #. Normalize the name to Unicode NFKD, which separates accents from their letters, and drop the
59
+ characters that are still not ASCII.
60
+ #. Lowercase it, and replace each run of characters other than letters and digits with one
61
+ underscore.
62
+ #. Trim underscores from both ends.
63
+
64
+ For example:
65
+
66
+ * "Course Designer" becomes ``custom_course_designer``.
67
+ * "Diseñador de cursos" becomes ``custom_disenador_de_cursos``.
68
+ * If that ID is taken, including by a removed role (section 4), the next one is
69
+ ``custom_course_designer_2``.
70
+ * A name with nothing left after conversion, such as one written only in a non-Latin script,
71
+ becomes ``custom_role``.
72
+
73
+ A custom role ID is at most 64 characters. The converted name is cut before the numeric suffix is
74
+ added, and underscores left at the end of the cut are trimmed. The role ID column allows 255
75
+ characters, but each assignment is also stored under a 255-character key that joins the subject,
76
+ role, and scope keys, so a short role ID leaves room for long scope keys. The display name keeps the
77
+ 255-character limit of its column.
78
+
79
+ Schema validation rejects static role IDs that start with ``custom_``, so the two kinds of role
80
+ cannot collide. The prefix also identifies custom roles in Casbin rows and logs.
81
+
82
+ The display name and description are stored as entered and are not translated (`ADR 0020`_). The
83
+ role's ``scopes`` stays a list, but the API accepts one resource type for now, so supporting several
84
+ later needs no data migration.
85
+
86
+ Role identifier conflicts (amends ADR 0018 section 4)
87
+ -----------------------------------------------------
88
+
89
+ `ADR 0018`_ section 4 handles static and custom role name collisions at runtime and leaves custom
90
+ role naming out of scope. The dynamic role API rejects a name used by a static role, and a
91
+ deployment stops when a new static role conflicts with an existing custom role. This ADR sets the
92
+ naming rule that section 4 left open, so it replaces that runtime handling:
93
+
94
+ * A static role can never collide with a custom role, because static IDs cannot start with
95
+ ``custom_`` and custom IDs always do. A deployment no longer stops because of a static and
96
+ custom role name conflict, and the custom role API no longer needs to check names against static
97
+ roles.
98
+ * A static role ID that starts with ``custom_`` is now a schema validation error, reported before
99
+ any database change, with the contributing package. This is where a package that already ships
100
+ such an ID is caught.
101
+ * Uniqueness among custom roles remains a runtime concern, handled by the numeric suffix
102
+ (``custom_course_designer_2``).
103
+
104
+ The rest of `ADR 0018`_ section 4 still applies: static and custom roles share one set of role IDs.
105
+ `ADR 0018`_ carries a matching addendum.
106
+
107
+ 3. Changes apply to the definition and the policy together
108
+ ==========================================================
109
+
110
+ Creating, editing, or removing a custom role updates its definition rows and its Casbin ``p`` rows
111
+ in one transaction, then invalidates the policy cache, as `ADR 0018`_ requires for deployments.
112
+ These writes use the same lock as schema apply. Changes apply right away to every user who holds the
113
+ role.
114
+
115
+ Copying a role is not a separate operation. The Administrative Console reads an existing role from
116
+ the catalog and sends its resource type and permissions, which the administrator can change, in a
117
+ normal create request. The catalog lists only roles that are not hidden, so only those
118
+ can be copied. The new role gets no assignments and keeps no link to the original.
119
+
120
+ 4. Removing a custom role
121
+ =========================
122
+
123
+ Removing a custom role keeps its role-definition row and marks it as removed, with the time of
124
+ removal. Its grants, its Casbin ``p`` rows, and its assignments are deleted in the same transaction.
125
+ A removed role is left out of the catalog, cannot be assigned or edited, and grants no access.
126
+
127
+ The role ID stays reserved, so creating "Course Designer" again gives ``custom_course_designer_2``.
128
+ Audit records (`ADR 0012`_) store role keys as plain strings. If a new role could take a removed
129
+ role's ID, its history would mix with the old role's records. Keeping the row also lets those
130
+ records show the removed role's display name.
131
+
132
+ When a custom role has assignments, the request to remove it must state explicitly that the
133
+ assignments are deleted with the role, or it is rejected. A role with no assignments needs no such
134
+ statement. Each deleted assignment is recorded the same way assignment removals are recorded today.
135
+
136
+ 5. Schema deployments
137
+ =====================
138
+
139
+ The schema loader does not create, update, or remove custom roles. When a deployment removes a
140
+ permission that a custom role grants, it stops before any write and
141
+ reports each affected grant, so Casbin keeps the last applied policy (`ADR 0018`_).
142
+
143
+ An explicit option, separate from the force option for removing roles, lets the operator drop
144
+ those grants and their ``p`` rows in the same deployment. A release that removes a permission must
145
+ say so in its operator release notes and name this option. A custom role left with no permissions
146
+ remains, so its assignments are kept.
147
+
148
+ Consequences
149
+ ************
150
+
151
+ * The catalog, the assignment flow, and enforcement read static and custom roles from the same
152
+ tables.
153
+ * The schema loader's prune step must skip custom roles and their grants. It drops a custom role's
154
+ grant only when the schema removed the permission and the operator passed the option from
155
+ section 5.
156
+ * A deployment cannot narrow a custom role unless the operator opts in, and releases that remove
157
+ permissions must document the option in their operator release notes.
158
+ * Removing a custom role cannot leave orphaned assignments.
159
+ * Removed custom roles stay in the role-definition table, so their IDs are never reused and audit
160
+ records can still name them. Queries for active roles must exclude them.
161
+ * Schema validation and the :ref:`Authorization Schema Reference` must reserve the ``custom_``
162
+ prefix.
163
+ * Custom roles have no source attribution.
164
+ * Static and custom role name conflicts are prevented by the ``custom_`` prefix rule instead of
165
+ detected at deployment, which supersedes the runtime conflict handling in `ADR 0018`_ section 4.
166
+
167
+ This ADR does not decide who can manage custom roles, the REST API contract, or how dependent
168
+ permissions are added. Future ADRs decide these. It also does not cover a change history for role
169
+ definitions or roles with several resource types.
170
+
171
+ Rejected Alternatives
172
+ *********************
173
+
174
+ Separate tables for custom roles
175
+ ================================
176
+
177
+ Every catalog query would have to merge two tables, the code that writes ``p`` rows would exist
178
+ twice, and the shared role ID rule from `ADR 0018`_ would have to be checked across both tables.
179
+
180
+ Infer custom roles from missing source links
181
+ ============================================
182
+
183
+ A role with no source links could also be a leftover or the result of an incomplete write. An
184
+ explicit definition kind avoids the guesswork and is the value the catalog already returns.
185
+
186
+ References
187
+ **********
188
+
189
+ * `ADR 0012`_
190
+ * `ADR 0016`_
191
+ * `ADR 0018`_
192
+ * `ADR 0020`_
193
+ * `ADR 0023`_
194
+ * `ADR 0025`_
195
+ * `ADR 0028`_
196
+ * `Issue #467`_
197
+
198
+ .. _ADR 0012: 0012-auditability.rst
199
+ .. _ADR 0016: 0016-static-and-dynamic-roles.rst
200
+ .. _ADR 0018: 0018-authorization-schema-lifecycle.rst
201
+ .. _ADR 0020: 0020-authorization-schema-internationalization.rst
202
+ .. _ADR 0023: 0023-extend-static-roles.rst
203
+ .. _ADR 0025: 0025-authorization-schema-source-tracking.rst
204
+ .. _ADR 0028: 0028-api-contract-for-role-catalog.rst
205
+ .. _Issue #467: https://github.com/openedx/openedx-authz/issues/467