openedx-authz 3.1.0__tar.gz → 4.0.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.
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/CHANGELOG.rst +3 -0
- {openedx_authz-3.1.0/src/openedx_authz.egg-info → openedx_authz-4.0.0}/PKG-INFO +1 -1
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0022-defer-authorization-implications.rst +7 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0028-api-contract-for-role-catalog.rst +8 -0
- openedx_authz-4.0.0/docs/decisions/0034-permission-dependencies-in-authorization-schema.rst +162 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/api/utils.py +1 -3
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/enrollments/README.rst +1 -1
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_administration/README.rst +1 -1
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_grading/README.rst +1 -1
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/authz/__init__.py +9 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/discovery.py +4 -10
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/parsing.py +7 -7
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/filters.py +2 -1
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/handlers.py +6 -2
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0010_scope_external_key.py +3 -4
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0011_authz_schema_definitions.py +2 -6
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/data.py +0 -7
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/admin_console/serializers.py +1 -10
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/admin_console/views.py +1 -1
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/course_authoring/pipeline.py +2 -7
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/course_authoring/views.py +1 -1
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/api/test_roles.py +4 -12
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/api/test_users.py +3 -9
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/applets/test_builtin_definitions.py +1 -3
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/applets/test_instructor_dashboard_permissions.py +8 -3
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/admin_console/test_views.py +8 -12
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/course_authoring/test_pipeline.py +16 -14
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/course_authoring/test_views.py +1 -3
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/test_views.py +1 -3
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_discovery.py +1 -5
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_loading.py +1 -6
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_translation.py +115 -39
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_imports.py +1 -3
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_migrations.py +1 -3
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_utils.py +36 -44
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/utils.py +1 -3
- {openedx_authz-3.1.0 → openedx_authz-4.0.0/src/openedx_authz.egg-info}/PKG-INFO +1 -1
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz.egg-info/SOURCES.txt +1 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz.egg-info/scm_file_list.json +1 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/uv.lock +385 -210
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.annotation_safe_list.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.editorconfig +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.github/dependabot.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.github/workflows/add-depr-ticket-to-depr-board.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.github/workflows/add-remove-label-on-comment.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.github/workflows/ci.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.github/workflows/commitlint.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.github/workflows/release.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.github/workflows/self-assign-issue.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.github/workflows/upgrade-python-requirements.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.gitignore +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.pii_annotations.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/.readthedocs.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/LICENSE +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/MANIFEST.in +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/Makefile +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/README.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/catalog-info.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/codecov.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/Makefile +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/_images/architecture-overview.png +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/_static/theme_overrides.css +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/changelog.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/concepts/core_roles_and_permissions/content_library_roles.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/concepts/core_roles_and_permissions/course_roles.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/concepts/core_roles_and_permissions/index.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/concepts/index.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/conf.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0001-purpose-of-this-repo.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0002-authorization-model-foundation.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0003-jwt-usage.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0004-technology-selection.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0005-architecture-and-data-modeling.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0007-enforcement-mechanisms-mfe.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0008-compatibility-scheme.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0009-authz-for-course-authoring.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0010-course-authoring-flag.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0011-course-authoring-migration-process.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0012-auditability.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0012-glob-support-for-role-assignments.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0013-course-authoring-automatic-migration.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0014-bulk-assignment-queries-without-casbin-enforce.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0015-expose-course-authoring-waffle-flag-state-via-rest-api.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0016-static-and-dynamic-roles.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0017-static-authorization-schema.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0018-authorization-schema-lifecycle.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0019-authorization-schema-discovery.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0020-authorization-schema-internationalization.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0021-authorization-definition-api.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0023-extend-static-roles.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0024-api-contract-for-user-grouped-role-assignments.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0025-authorization-schema-source-tracking.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0026-rest-api-domain-ownership-boundary.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0027-cross-domain-filtering-via-openedx-filters.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0029-paragon-icon-list-maintenance.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0030-tutor-implementation-authz-schema-discovery.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0031-priority-applies-to-role-extensions-only.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0032-applets-for-built-in-authorization-capabilities.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0033-shared-applet-for-course-team-roles.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/README.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/getting_started.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/how-tos/index.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/how-tos/use-built-in-constants.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/index.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/internationalization.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/make.bat +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/quickstarts/index.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/readme.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/references/authorization-schema-json.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/references/authorization-schema.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/references/built-in-constants.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/references/compiled-schema.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/references/compiled-schema.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/references/index.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/testing.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/manage.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/pylintrc +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/pylintrc_tweaks +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/pyproject.toml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/ruff.toml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/scripts/generate_compiled_schema.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/scripts/generate_paragon_icons.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/setup.cfg +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/admin.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/api/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/api/catalog.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/api/data.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/api/permissions.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/api/roles.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/api/users.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/content_libraries/README.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/content_libraries/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/content_libraries/constants.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/content_libraries/schema/permissions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/content_libraries/schema/roles.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_authoring/README.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_authoring/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_authoring/constants.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_authoring/schema/permissions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_authoring/schema/role_extensions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_team_roles/README.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_team_roles/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_team_roles/constants.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_team_roles/schema/legacy_permissions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_team_roles/schema/roles.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/enrollments/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/enrollments/constants.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/enrollments/schema/permissions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/enrollments/schema/role_extensions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_administration/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_administration/constants.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_administration/schema/permissions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_administration/schema/role_extensions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_grading/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_grading/constants.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_grading/schema/permissions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_grading/schema/role_extensions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/apps.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/conf/locale/config.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/constants/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/constants/permissions.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/constants/roles.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/constants/schema.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/data.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/adapter.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/apps.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/config/model.conf +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/enforcer.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/filter.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/matcher.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/policy.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/renderer.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/authz-schema-v1.json +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/compilation.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/exceptions.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/issues.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/loading.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/paragon_icons.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/pipeline.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/snapshot.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/syntax.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/translation.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/types/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/types/compilation.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/types/definitions.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/types/loading.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/validation.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/utils.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/management/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/authz_migrate_course_authoring.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/authz_rollback_course_authoring.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/enforcement.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/extract_schema_translations.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/load_authz_schema.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/load_policies.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0001_add_casbin_dependency.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0002_initial.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0003_usersubject.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0004_contentlibraryscope.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0005_policycachecontrol.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0006_migrate_legacy_permissions.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0007_coursescope.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0008_authzcourseauthoringmigrationrun.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0009_roleassignmentaudit.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0012_move_builtin_schema_sources_to_applets.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/models/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/models/authz_migration.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/models/base.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/models/core.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/models/engine.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/models/schema.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/models/scopes.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/models/subjects.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/decorators.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/urls.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/utils.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/admin_console/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/admin_console/filters.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/course_authoring/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/fields.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/paginators.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/permissions.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/serializers.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/urls.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/views.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/settings/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/settings/common.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/settings/production.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/settings/test.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/templates/openedx_authz/base.html +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/api/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/api/test_catalog.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/api/test_data.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/applets/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/authz/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/authz/test_resources.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/conftest.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_compiled/categories.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_compiled/extensions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_compiled/permissions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_compiled/roles.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_parse/malformed.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_semantics/unknown_category.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_structure/items.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_structure/priority.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/valid/categories.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/valid/extensions.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/valid/permissions.yml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/valid/roles.yaml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/test_handlers.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/test_models.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/test_schema_apply.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/test_schema_pipeline.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/test_views.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/admin_console/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/course_authoring/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/mixins.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/test_permissions.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/test_utils.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/role_permissions.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/factories.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_apply.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_compilation.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_json_schema.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_load_authz_schema_command.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_parsing.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_pipeline.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_renderer.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_schema_models.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_snapshot.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_source_storage.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_syntax.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_types.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_validation.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/stubs/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/stubs/apps.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/stubs/migrations/0001_initial.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/stubs/migrations/0002_learningpackage_contentlibrary_learning_package.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/stubs/migrations/0002_userprofile.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/stubs/models.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_commands.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_enforcement.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_enforcer.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_engine_utils.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_filter.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_handlers.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_models.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_policy.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/urls.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz.egg-info/dependency_links.txt +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz.egg-info/entry_points.txt +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz.egg-info/requires.txt +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz.egg-info/top_level.txt +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/tox.ini +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/.gitignore +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/LICENSE.txt +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/MANIFEST.in +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/Makefile +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/README.rst +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/pyproject.toml +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/tutor_authz/__about__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/tutor_authz/__init__.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/tutor_authz/patches/openedx-common-settings +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/tutor_authz/plugin.py +0 -0
- {openedx_authz-3.1.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/tutor_authz/templates/apps/openedx/config/authz-schema.yml +0 -0
|
@@ -58,6 +58,9 @@ Changed
|
|
|
58
58
|
|
|
59
59
|
* Static roles may declare an empty permission list when ``role_extensions`` contribute their permissions. Permission lists used by extension edits remain non-empty.
|
|
60
60
|
* 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
|
+
* **Breaking**: ``GET /api/authz/v1/scopes/`` no longer accepts ``course`` and ``library`` as
|
|
62
|
+
``scope_type`` values. Use ``course-v1`` and ``lib`` instead. Requests with the old values now
|
|
63
|
+
return a 400 validation error, the same as ``/roles/``.
|
|
61
64
|
|
|
62
65
|
Removed
|
|
63
66
|
=======
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openedx-authz
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.0.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
|
{openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0022-defer-authorization-implications.rst
RENAMED
|
@@ -52,6 +52,11 @@ Static role-permission policies moved from ``authz.policy`` to the authorization
|
|
|
52
52
|
|
|
53
53
|
New installations no longer load the default ``g2`` relationships that were stored in ``authz.policy``. `Issue #91`_ and `Issue #523`_ track defining permission dependencies in the authorization schema.
|
|
54
54
|
|
|
55
|
+
Addendum: Permission Dependencies (2026-11-04)
|
|
56
|
+
==============================================
|
|
57
|
+
|
|
58
|
+
`ADR 0034`_ adds permission dependencies to schema version 1.1 through an optional ``depends_on`` field, and the renderer generates the ``g2`` rows from it. That ADR replaces the permission-implication part of this decision. Role inheritance remains deferred.
|
|
59
|
+
|
|
55
60
|
Rejected Alternatives
|
|
56
61
|
*********************
|
|
57
62
|
|
|
@@ -69,9 +74,11 @@ References
|
|
|
69
74
|
**********
|
|
70
75
|
|
|
71
76
|
* `ADR 0017`_
|
|
77
|
+
* `ADR 0034`_
|
|
72
78
|
* `Issue #91`_
|
|
73
79
|
* `Issue #523`_
|
|
74
80
|
|
|
75
81
|
.. _ADR 0017: 0017-static-authorization-schema.rst
|
|
82
|
+
.. _ADR 0034: 0034-permission-dependencies-in-authorization-schema.rst
|
|
76
83
|
.. _Issue #91: https://github.com/openedx/openedx-authz/issues/91
|
|
77
84
|
.. _Issue #523: https://github.com/openedx/openedx-authz/issues/523
|
{openedx_authz-3.1.0 → openedx_authz-4.0.0}/docs/decisions/0028-api-contract-for-role-catalog.rst
RENAMED
|
@@ -409,7 +409,15 @@ References
|
|
|
409
409
|
* `ADR 0025`_
|
|
410
410
|
* `ADR 0029`_
|
|
411
411
|
|
|
412
|
+
Addendum: 2026-11-11
|
|
413
|
+
********************
|
|
414
|
+
|
|
415
|
+
The deprecated ``course`` and ``library`` aliases of ``GET /api/authz/v1/scopes/`` were removed after the Admin Console migrated to ``course-v1`` and ``lib`` (`Issue #536`_). ``/scopes/`` and ``/roles/`` now accept only these values, and the short names are rejected as invalid choices.
|
|
416
|
+
|
|
417
|
+
This addendum replaces the alias bullets in "Scope type naming" and the mention of the aliases in the consequences.
|
|
418
|
+
|
|
412
419
|
.. _frontend-app-admin-console: https://github.com/openedx/frontend-app-admin-console
|
|
420
|
+
.. _Issue #536: https://github.com/openedx/openedx-authz/issues/536
|
|
413
421
|
.. _ADR 0020: 0020-authorization-schema-internationalization.rst
|
|
414
422
|
.. _ADR 0021: 0021-authorization-definition-api.rst
|
|
415
423
|
.. _ADR 0023: 0023-extend-static-roles.rst
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
0034: Define Permission Dependencies in the Authorization Schema
|
|
2
|
+
################################################################
|
|
3
|
+
|
|
4
|
+
Status
|
|
5
|
+
******
|
|
6
|
+
|
|
7
|
+
**Draft**
|
|
8
|
+
|
|
9
|
+
Context
|
|
10
|
+
*******
|
|
11
|
+
|
|
12
|
+
Before `PR #538`_, ``authz.policy`` declared permission dependencies as Casbin ``g2`` rows. For example, ``g2, act^content_libraries.edit_library_content, act^content_libraries.view_library`` meant that editing library content requires viewing the library. That PR moved static roles and permissions into the authorization schema (`ADR 0017`_) and removed the policy file, but the schema had no field for dependencies, so new installations no longer load them.
|
|
13
|
+
|
|
14
|
+
The Custom Roles feature needs these dependencies for two reasons:
|
|
15
|
+
|
|
16
|
+
* When an administrator enables a permission, the UI also selects every permission it depends on. When an administrator disables a permission that other selected permissions depend on, the UI warns first and then also disables those permissions.
|
|
17
|
+
* The ``g2`` rows must be generated from the schema rather than from a policy file.
|
|
18
|
+
|
|
19
|
+
`ADR 0022`_ deferred permission implication and listed what a later schema version must define before adding it. This ADR adds permission dependencies and covers those points.
|
|
20
|
+
|
|
21
|
+
Decision
|
|
22
|
+
********
|
|
23
|
+
|
|
24
|
+
1. Syntax
|
|
25
|
+
=========
|
|
26
|
+
|
|
27
|
+
A permission may declare an optional ``depends_on`` list with the complete IDs of the permissions it directly requires. A dependency means that granting the permission also grants the permissions it depends on. For example, granting ``edit_library_content`` also grants ``view_library``, because a user cannot edit the content of a library they cannot view.
|
|
28
|
+
|
|
29
|
+
.. code-block:: yaml
|
|
30
|
+
|
|
31
|
+
permissions:
|
|
32
|
+
- namespace: content_libraries
|
|
33
|
+
name: edit_library_content
|
|
34
|
+
display_name: Edit
|
|
35
|
+
# ...
|
|
36
|
+
scopes:
|
|
37
|
+
- lib
|
|
38
|
+
depends_on:
|
|
39
|
+
- content_libraries.view_library
|
|
40
|
+
|
|
41
|
+
Only the file that defines a permission declares its dependencies. Role extensions cannot add or remove dependencies.
|
|
42
|
+
|
|
43
|
+
2. Schema version
|
|
44
|
+
=================
|
|
45
|
+
|
|
46
|
+
``depends_on`` is allowed only in files that declare ``schema_version: "1.1"``. The field stays optional in ``1.1``, so a ``1.1`` file that declares no ``depends_on`` is valid and means the same as it would in ``1.0``. Files that declare ``"1.0"`` keep their current meaning, and a ``1.0`` file that declares ``depends_on`` is rejected as an unknown field.
|
|
47
|
+
|
|
48
|
+
``1.0`` and ``1.1`` files are a supported combination. The "unsupported combinations of schema versions" check in `ADR 0017`_ does not reject a deployment that loads both, so a file can move to ``1.1`` without requiring every other file to move with it. For example, ``library_permissions.yaml`` can declare ``1.1`` and ``depends_on``, while ``library_roles.yaml`` stays at ``1.0``.
|
|
49
|
+
|
|
50
|
+
Version ``1.1`` has its own JSON Schema file, ``authz-schema-v1.1.json``, next to the existing ``authz-schema-v1.json``. The existing file keeps ``"const": "1.0"`` and does not change, so tools that validate ``1.0`` files continue to work. The ``1.1`` file accepts everything ``1.0`` accepts and adds the optional ``depends_on`` field. The validator selects the JSON Schema file from the ``schema_version`` that each file declares.
|
|
51
|
+
|
|
52
|
+
3. Validation
|
|
53
|
+
=============
|
|
54
|
+
|
|
55
|
+
Validation rejects:
|
|
56
|
+
|
|
57
|
+
* a dependency on a permission that is not defined;
|
|
58
|
+
* a permission that depends on itself, or a dependency cycle;
|
|
59
|
+
* a dependency whose scope namespaces do not include every scope namespace of the dependent permission; and
|
|
60
|
+
* a role whose resolved permissions, after role extensions are applied, include a permission but not all of its direct and indirect dependencies.
|
|
61
|
+
|
|
62
|
+
The last rule means a role always lists every permission it grants, and a ``remove_permissions`` extension cannot remove a dependency that another permission on the role still needs. It applies to roles and role extensions in every file, regardless of the ``schema_version`` the file declares.
|
|
63
|
+
|
|
64
|
+
4. Casbin representation
|
|
65
|
+
========================
|
|
66
|
+
|
|
67
|
+
The renderer creates one ``g2`` row for each direct dependency:
|
|
68
|
+
|
|
69
|
+
.. code-block:: text
|
|
70
|
+
|
|
71
|
+
g2, act^content_libraries.edit_library_content, act^content_libraries.view_library
|
|
72
|
+
|
|
73
|
+
The renderer owns these rows and adds, adopts, and removes them the same way it handles ``p`` rows (`ADR 0018`_, `ADR 0025`_). ``model.conf`` and its matcher do not change.
|
|
74
|
+
|
|
75
|
+
For schema roles, the validation in section 3 already makes ``g2`` rows redundant, because every role lists its dependencies. The rows are still rendered because:
|
|
76
|
+
|
|
77
|
+
* Roles that do not pass through schema validation, such as roles stored only in the database and ``p`` rows that no schema declares, can still be missing a dependency. The ``g2`` row grants the dependency, so a permission on such a role still works.
|
|
78
|
+
* The matcher already checks ``g2``, and existing installations already store these rows, so authorization decisions stay the same as before `PR #538`_.
|
|
79
|
+
* The dependencies stay in the Casbin policy, where tools that read the policy, such as the ``enforcement`` management command, can see them.
|
|
80
|
+
|
|
81
|
+
5. Definition storage
|
|
82
|
+
=====================
|
|
83
|
+
|
|
84
|
+
The loader stores each direct dependency as one row that links a permission definition to the permission it depends on, next to the definition tables from `ADR 0025`_. Each row corresponds to one rendered ``g2`` row, in the same way each stored role-permission grant corresponds to one ``p`` row. The row has no scope, because ``g2`` rows have none.
|
|
85
|
+
|
|
86
|
+
Dependencies do not have their own source records. Only the file that defines a permission declares its dependencies, so a dependency's source is the permission's source. Two files that define the same permission with different dependencies are a base-definition conflict, which validation rejects (`ADR 0031`_).
|
|
87
|
+
|
|
88
|
+
The renderer uses these rows to decide which ``g2`` rows it owns:
|
|
89
|
+
|
|
90
|
+
* A stored ``g2`` row that matches a rendered one, such as a row loaded from ``authz.policy`` before `PR #538`_, is adopted without being rewritten.
|
|
91
|
+
* A stored ``g2`` row that no schema declares stays in place and unattributed, like unmanaged ``p`` rows.
|
|
92
|
+
* When a dependency leaves the schema, or its permission is removed, the renderer removes the dependency row and its ``g2`` row in the same transaction.
|
|
93
|
+
|
|
94
|
+
6. API
|
|
95
|
+
======
|
|
96
|
+
|
|
97
|
+
The role catalog (`ADR 0028`_) returns each permission's direct ``depends_on`` list. Clients compute indirect dependencies when they need them. Because of the role rule in section 3, a role's listed permissions are the same as the permissions it grants, so the API does not need to separate direct and implied permissions.
|
|
98
|
+
|
|
99
|
+
7. UI behavior
|
|
100
|
+
==============
|
|
101
|
+
|
|
102
|
+
The UI uses ``depends_on`` in both directions when an administrator edits the permissions of a custom role:
|
|
103
|
+
|
|
104
|
+
* When the administrator selects a permission, the UI also selects every permission it depends on, directly or indirectly.
|
|
105
|
+
* When the administrator deselects a permission that other selected permissions depend on, the UI warns the administrator before deselecting it. The warning lists the permissions that will also be deselected. If the administrator confirms, the UI deselects the permission and every selected permission that depends on it, directly or indirectly. If the administrator cancels, nothing changes.
|
|
106
|
+
|
|
107
|
+
The UI computes the permissions that depend on a given permission by reversing the ``depends_on`` lists it received from the role catalog (section 6). The role rule in section 3 stays the authoritative check, so a request that leaves a permission selected without its dependencies is rejected by the Custom Roles API regardless of what the UI does.
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
Consequences
|
|
111
|
+
************
|
|
112
|
+
|
|
113
|
+
* New installations load library ``g2`` rows again.
|
|
114
|
+
* Schema authors declare dependencies once, on the permission they belong to.
|
|
115
|
+
* A schema that adds a permission to a role without its dependencies fails validation, including a ``1.0`` file that lists a permission to which a ``1.1`` file has added ``depends_on``.
|
|
116
|
+
* ``1.0`` files, and ``1.1`` files that do not use ``depends_on``, keep their current meaning, and ``1.0`` and ``1.1`` files can be loaded together.
|
|
117
|
+
* The repository ships a second JSON Schema file for ``1.1``, which must be kept in sync with ``authz-schema-v1.json`` for the fields they share.
|
|
118
|
+
* Tests check the validation rules and confirm that enforcement results match the explicit role permissions.
|
|
119
|
+
* The Custom Roles API should apply the same role rule to roles that users create.
|
|
120
|
+
|
|
121
|
+
Rejected Alternatives
|
|
122
|
+
*********************
|
|
123
|
+
|
|
124
|
+
Top-level ``permission_dependencies`` section
|
|
125
|
+
=============================================
|
|
126
|
+
|
|
127
|
+
A separate section would let any file add dependencies to a permission it does not own, which would require the override rules that `ADR 0031`_ avoids for base definitions.
|
|
128
|
+
|
|
129
|
+
Dependencies as display metadata only
|
|
130
|
+
=====================================
|
|
131
|
+
|
|
132
|
+
The UI would select dependencies, but Casbin would have no ``g2`` rows. The schema would then not be the full source for the Casbin policy.
|
|
133
|
+
|
|
134
|
+
Role inheritance
|
|
135
|
+
================
|
|
136
|
+
|
|
137
|
+
Inheritance links roles, not permissions. It does not tell the UI which permissions to select together.
|
|
138
|
+
|
|
139
|
+
References
|
|
140
|
+
**********
|
|
141
|
+
|
|
142
|
+
* `ADR 0017`_
|
|
143
|
+
* `ADR 0018`_
|
|
144
|
+
* `ADR 0022`_
|
|
145
|
+
* `ADR 0025`_
|
|
146
|
+
* `ADR 0028`_
|
|
147
|
+
* `ADR 0031`_
|
|
148
|
+
* `Issue #91`_
|
|
149
|
+
* `Issue #523`_
|
|
150
|
+
* `PR #538`_
|
|
151
|
+
* `Casbin RBAC documentation`_
|
|
152
|
+
|
|
153
|
+
.. _ADR 0017: 0017-static-authorization-schema.rst
|
|
154
|
+
.. _ADR 0018: 0018-authorization-schema-lifecycle.rst
|
|
155
|
+
.. _ADR 0022: 0022-defer-authorization-implications.rst
|
|
156
|
+
.. _ADR 0025: 0025-authorization-schema-source-tracking.rst
|
|
157
|
+
.. _ADR 0028: 0028-api-contract-for-role-catalog.rst
|
|
158
|
+
.. _ADR 0031: 0031-priority-applies-to-role-extensions-only.rst
|
|
159
|
+
.. _Issue #91: https://github.com/openedx/openedx-authz/issues/91
|
|
160
|
+
.. _Issue #523: https://github.com/openedx/openedx-authz/issues/523
|
|
161
|
+
.. _PR #538: https://github.com/openedx/openedx-authz/pull/538
|
|
162
|
+
.. _Casbin RBAC documentation: https://casbin.apache.org/docs/rbac#named-role-systems-and-permission-dependencies
|
|
@@ -100,9 +100,7 @@ def get_scope_display_name_map(scope_external_keys: set[str]) -> dict[str, str]:
|
|
|
100
100
|
if library_scopes and ContentLibrary is not None:
|
|
101
101
|
lib_pairs = {(s.library_key.org, s.library_key.slug) for s in library_scopes}
|
|
102
102
|
try:
|
|
103
|
-
lib_filter = reduce(
|
|
104
|
-
operator.or_, (Q(org__short_name=org, slug=slug) for org, slug in lib_pairs)
|
|
105
|
-
)
|
|
103
|
+
lib_filter = reduce(operator.or_, (Q(org__short_name=org, slug=slug) for org, slug in lib_pairs))
|
|
106
104
|
lib_qs = ContentLibrary.objects.filter(lib_filter).select_related("learning_package", "org")
|
|
107
105
|
|
|
108
106
|
for lib in lib_qs:
|
{openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/enrollments/README.rst
RENAMED
|
@@ -3,4 +3,4 @@ Enrollments
|
|
|
3
3
|
|
|
4
4
|
This applet owns the permissions for viewing course enrollments and for enrolling or unenrolling learners, which belong to the Content Access / Enrollments bounded context. It adds those permissions to the ``course_admin`` and ``course_staff`` roles through role extensions. ``constants.py`` contains its permission objects.
|
|
5
5
|
|
|
6
|
-
The applet is an internal package, so clients import these constants from ``openedx_authz.constants.permissions
|
|
6
|
+
The applet is an internal package, so clients import these constants from ``openedx_authz.authz``. The existing ``openedx_authz.constants.permissions`` path remains a compatibility export.
|
|
@@ -3,4 +3,4 @@ Learner Administration
|
|
|
3
3
|
|
|
4
4
|
This applet owns the permissions for viewing course information and managing learner extensions and cohorts, which belong to the Support Learning bounded context. It adds those permissions to the ``course_admin`` and ``course_staff`` roles through role extensions. ``constants.py`` contains its permission objects.
|
|
5
5
|
|
|
6
|
-
The applet is an internal package, so clients import these constants from ``openedx_authz.constants.permissions
|
|
6
|
+
The applet is an internal package, so clients import these constants from ``openedx_authz.authz``. The existing ``openedx_authz.constants.permissions`` path remains a compatibility export.
|
{openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_grading/README.rst
RENAMED
|
@@ -3,4 +3,4 @@ Learner Grading
|
|
|
3
3
|
|
|
4
4
|
This applet owns the permissions for viewing the gradebook and using grading tools for individual learners, which belong to the Consuming Learning Content bounded context. It adds those permissions to the ``course_admin`` and ``course_staff`` roles through role extensions. ``constants.py`` contains its permission objects.
|
|
5
5
|
|
|
6
|
-
The applet is an internal package, so clients import these constants from ``openedx_authz.constants.permissions
|
|
6
|
+
The applet is an internal package, so clients import these constants from ``openedx_authz.authz``. The existing ``openedx_authz.constants.permissions`` path remains a compatibility export.
|
|
@@ -23,6 +23,12 @@ from openedx_authz.applets.course_authoring.constants import *
|
|
|
23
23
|
from openedx_authz.applets.course_authoring.constants import __all__ as _course_authoring_constants
|
|
24
24
|
from openedx_authz.applets.course_team_roles.constants import *
|
|
25
25
|
from openedx_authz.applets.course_team_roles.constants import __all__ as _course_team_constants
|
|
26
|
+
from openedx_authz.applets.enrollments.constants import *
|
|
27
|
+
from openedx_authz.applets.enrollments.constants import __all__ as _enrollments_constants
|
|
28
|
+
from openedx_authz.applets.learner_administration.constants import *
|
|
29
|
+
from openedx_authz.applets.learner_administration.constants import __all__ as _learner_administration_constants
|
|
30
|
+
from openedx_authz.applets.learner_grading.constants import *
|
|
31
|
+
from openedx_authz.applets.learner_grading.constants import __all__ as _learner_grading_constants
|
|
26
32
|
|
|
27
33
|
# Directory paths (relative to an importable top-level package) that contain
|
|
28
34
|
# this distribution's ``.yaml`` schema files. Per ADR 0019, providers return
|
|
@@ -42,6 +48,9 @@ __all__ = [
|
|
|
42
48
|
*_content_library_constants,
|
|
43
49
|
*_course_authoring_constants,
|
|
44
50
|
*_course_team_constants,
|
|
51
|
+
*_enrollments_constants,
|
|
52
|
+
*_learner_administration_constants,
|
|
53
|
+
*_learner_grading_constants,
|
|
45
54
|
]
|
|
46
55
|
|
|
47
56
|
|
|
@@ -143,9 +143,7 @@ class DiscoveredFileResource(DiscoveredResource):
|
|
|
143
143
|
try:
|
|
144
144
|
return Path(self.resource_path).read_bytes()
|
|
145
145
|
except OSError as exc:
|
|
146
|
-
raise SchemaDiscoveryError(
|
|
147
|
-
f"Could not read schema file {self.resource_path!r}: {exc}"
|
|
148
|
-
) from exc
|
|
146
|
+
raise SchemaDiscoveryError(f"Could not read schema file {self.resource_path!r}: {exc}") from exc
|
|
149
147
|
|
|
150
148
|
|
|
151
149
|
class SchemaDiscoveryError(Exception):
|
|
@@ -250,8 +248,7 @@ class SchemaDiscovery:
|
|
|
250
248
|
return []
|
|
251
249
|
if not isinstance(file_paths, list):
|
|
252
250
|
raise SchemaDiscoveryError(
|
|
253
|
-
"OPENEDX_AUTHZ_SCHEMA_FILES must be a list of filesystem paths, "
|
|
254
|
-
f"got {type(file_paths).__name__!r}."
|
|
251
|
+
"OPENEDX_AUTHZ_SCHEMA_FILES must be a list of filesystem paths, " f"got {type(file_paths).__name__!r}."
|
|
255
252
|
)
|
|
256
253
|
discovered: list[DiscoveredResource] = []
|
|
257
254
|
for file_path in file_paths:
|
|
@@ -265,13 +262,10 @@ class SchemaDiscovery:
|
|
|
265
262
|
path = Path(file_path)
|
|
266
263
|
if not path.is_file():
|
|
267
264
|
raise SchemaDiscoveryError(
|
|
268
|
-
f"Schema file {file_path!r} contributed through "
|
|
269
|
-
"OPENEDX_AUTHZ_SCHEMA_FILES is not an actual file"
|
|
265
|
+
f"Schema file {file_path!r} contributed through " "OPENEDX_AUTHZ_SCHEMA_FILES is not an actual file"
|
|
270
266
|
)
|
|
271
267
|
|
|
272
|
-
discovered.append(
|
|
273
|
-
DiscoveredFileResource.from_path(file_path)
|
|
274
|
-
)
|
|
268
|
+
discovered.append(DiscoveredFileResource.from_path(file_path))
|
|
275
269
|
return discovered
|
|
276
270
|
|
|
277
271
|
def _iter_directory(self, directory: str, *, origin: Origin) -> list[DiscoveredResource]:
|
|
@@ -54,7 +54,7 @@ class SchemaParser:
|
|
|
54
54
|
|
|
55
55
|
@staticmethod
|
|
56
56
|
def parse_yamls(contents: bytes, resource: DiscoveredResource) -> list[object]:
|
|
57
|
-
"""Parse YAML bytes as a multi-document stream, skipping empty
|
|
57
|
+
"""Parse YAML bytes as a multi-document stream, skipping empty
|
|
58
58
|
documents, and preserve the resulting root value.
|
|
59
59
|
"""
|
|
60
60
|
try:
|
|
@@ -73,12 +73,12 @@ class SchemaParser:
|
|
|
73
73
|
distribution, version = self.resolve_distribution(resource)
|
|
74
74
|
content_digest = hashlib.sha256(contents).hexdigest()
|
|
75
75
|
source_record = {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
"distribution": distribution,
|
|
77
|
+
"distribution_version": version,
|
|
78
|
+
"module": resource.module,
|
|
79
|
+
"resource_path": resource.resource_path,
|
|
80
|
+
"schema_version": schema_version,
|
|
81
|
+
"content_digest": content_digest,
|
|
82
82
|
}
|
|
83
83
|
if isinstance(resource, DiscoveredFileResource):
|
|
84
84
|
return SourceFileRecord(**source_record)
|
|
@@ -47,7 +47,8 @@ class AuthorizationDataRequested(OpenEdxPublicFilter, Generic[AuthorizationItems
|
|
|
47
47
|
|
|
48
48
|
@classmethod
|
|
49
49
|
def run_filter(
|
|
50
|
-
cls,
|
|
50
|
+
cls,
|
|
51
|
+
items: AuthorizationItems,
|
|
51
52
|
) -> tuple[AuthorizationItems, list[dict[str, Any]]]:
|
|
52
53
|
"""
|
|
53
54
|
Run the operation's configured pipeline with an initially empty error list.
|
|
@@ -161,7 +161,9 @@ def backfill_course_scope(sender, instance, **kwargs): # pylint: disable=unused
|
|
|
161
161
|
CourseScope.link_pending_scope(instance)
|
|
162
162
|
except Exception as exc: # pylint: disable=broad-exception-caught
|
|
163
163
|
logger.exception(
|
|
164
|
-
"Error linking pending CourseScope to CourseOverview %s",
|
|
164
|
+
"Error linking pending CourseScope to CourseOverview %s",
|
|
165
|
+
instance.pk,
|
|
166
|
+
exc_info=exc,
|
|
165
167
|
)
|
|
166
168
|
|
|
167
169
|
|
|
@@ -177,7 +179,9 @@ def backfill_content_library_scope(sender, instance, **kwargs): # pylint: disab
|
|
|
177
179
|
ContentLibraryScope.link_pending_scope(instance)
|
|
178
180
|
except Exception as exc: # pylint: disable=broad-exception-caught
|
|
179
181
|
logger.exception(
|
|
180
|
-
"Error linking pending ContentLibraryScope to ContentLibrary %s",
|
|
182
|
+
"Error linking pending ContentLibraryScope to ContentLibrary %s",
|
|
183
|
+
instance.pk,
|
|
184
|
+
exc_info=exc,
|
|
181
185
|
)
|
|
182
186
|
|
|
183
187
|
|
{openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0010_scope_external_key.py
RENAMED
|
@@ -4,15 +4,14 @@ from django.db import migrations, models
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class Migration(migrations.Migration):
|
|
7
|
-
|
|
8
7
|
dependencies = [
|
|
9
|
-
(
|
|
8
|
+
("openedx_authz", "0009_roleassignmentaudit"),
|
|
10
9
|
]
|
|
11
10
|
|
|
12
11
|
operations = [
|
|
13
12
|
migrations.AddField(
|
|
14
|
-
model_name=
|
|
15
|
-
name=
|
|
13
|
+
model_name="scope",
|
|
14
|
+
name="external_key",
|
|
16
15
|
field=models.CharField(blank=True, max_length=255, null=True, unique=True),
|
|
17
16
|
),
|
|
18
17
|
]
|
|
@@ -301,9 +301,7 @@ class Migration(migrations.Migration):
|
|
|
301
301
|
),
|
|
302
302
|
migrations.AddConstraint(
|
|
303
303
|
model_name="authzschemasource",
|
|
304
|
-
constraint=models.UniqueConstraint(
|
|
305
|
-
fields=["distribution", "module"], name="authz_source_dist_module_uniq"
|
|
306
|
-
),
|
|
304
|
+
constraint=models.UniqueConstraint(fields=["distribution", "module"], name="authz_source_dist_module_uniq"),
|
|
307
305
|
),
|
|
308
306
|
migrations.AddConstraint(
|
|
309
307
|
model_name="authzpermissiondefinition",
|
|
@@ -321,9 +319,7 @@ class Migration(migrations.Migration):
|
|
|
321
319
|
),
|
|
322
320
|
migrations.AddConstraint(
|
|
323
321
|
model_name="authzpermissionsource",
|
|
324
|
-
constraint=models.UniqueConstraint(
|
|
325
|
-
fields=["permission", "source"], name="authz_permission_source_uniq"
|
|
326
|
-
),
|
|
322
|
+
constraint=models.UniqueConstraint(fields=["permission", "source"], name="authz_permission_source_uniq"),
|
|
327
323
|
),
|
|
328
324
|
migrations.AddConstraint(
|
|
329
325
|
model_name="authzrolesource",
|
|
@@ -99,10 +99,3 @@ class SerializedAssignment(TypedDict, total=False):
|
|
|
99
99
|
scope: str
|
|
100
100
|
scope_display_name: str
|
|
101
101
|
permission_count: int
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
DEPRECATED_SCOPE_TYPE_ALIASES = {
|
|
105
|
-
"course": ScopesTypeField.COURSE,
|
|
106
|
-
"library": ScopesTypeField.LIBRARY,
|
|
107
|
-
}
|
|
108
|
-
"""Short names that ``GET /api/authz/v1/scopes/`` still accepts until the Admin Console migrates."""
|
|
@@ -7,7 +7,6 @@ from rest_framework import serializers
|
|
|
7
7
|
from openedx_authz import api
|
|
8
8
|
from openedx_authz.api.data import UserAssignments
|
|
9
9
|
from openedx_authz.rest_api.data import (
|
|
10
|
-
DEPRECATED_SCOPE_TYPE_ALIASES,
|
|
11
10
|
AssignmentSortField,
|
|
12
11
|
ScopesTypeField,
|
|
13
12
|
UserAssignmentSortField,
|
|
@@ -26,19 +25,11 @@ class OrgMixin(serializers.Serializer): # pylint: disable=abstract-method
|
|
|
26
25
|
org = serializers.CharField(required=False, max_length=255)
|
|
27
26
|
|
|
28
27
|
|
|
29
|
-
class ScopeTypeAliasField(serializers.ChoiceField):
|
|
30
|
-
"""Scope type choice that also accepts the deprecated short names (``course``, ``library``)."""
|
|
31
|
-
|
|
32
|
-
def to_internal_value(self, data):
|
|
33
|
-
"""Map a deprecated short name to its scope type before validating the choice."""
|
|
34
|
-
return super().to_internal_value(DEPRECATED_SCOPE_TYPE_ALIASES.get(data, data))
|
|
35
|
-
|
|
36
|
-
|
|
37
28
|
class ListScopesQuerySerializer(OrgMixin): # pylint: disable=abstract-method
|
|
38
29
|
"""Serializer for validating query parameters in ScopesAPIView."""
|
|
39
30
|
|
|
40
31
|
management_permission_only = serializers.BooleanField(required=False, default=False)
|
|
41
|
-
scope_type =
|
|
32
|
+
scope_type = serializers.ChoiceField(
|
|
42
33
|
choices=[(e.value, e.name) for e in ScopesTypeField], required=False, default=None, allow_null=True
|
|
43
34
|
)
|
|
44
35
|
search = serializers.CharField(required=False, default="", allow_blank=True)
|
{openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/admin_console/views.py
RENAMED
|
@@ -210,7 +210,7 @@ class AdminConsoleOrgsAPIView(generics.ListAPIView):
|
|
|
210
210
|
apidocs.query_parameter(
|
|
211
211
|
"scope_type",
|
|
212
212
|
str,
|
|
213
|
-
description="Filter by scope type. Either 'course' or '
|
|
213
|
+
description="Filter by scope type. Either 'course-v1' or 'lib'. Returns both if not specified.",
|
|
214
214
|
),
|
|
215
215
|
],
|
|
216
216
|
responses={
|
|
@@ -122,11 +122,7 @@ class CourseAuthoringVisibilityFilter(PipelineStep, Generic[AuthorizationItems])
|
|
|
122
122
|
Returns:
|
|
123
123
|
set[str]: Scope keys hidden by the flag.
|
|
124
124
|
"""
|
|
125
|
-
return {
|
|
126
|
-
scope
|
|
127
|
-
for scope in scopes
|
|
128
|
-
if scope and not is_scope_visible(api.ScopeData(external_key=scope))
|
|
129
|
-
}
|
|
125
|
+
return {scope for scope in scopes if scope and not is_scope_visible(api.ScopeData(external_key=scope))}
|
|
130
126
|
|
|
131
127
|
@staticmethod
|
|
132
128
|
def _role_change_errors(user_identifiers: list[str], hidden_scopes: Iterable[str]) -> list[dict]:
|
|
@@ -186,8 +182,7 @@ class CourseAuthoringPermissionValidationFilter(CourseAuthoringVisibilityFilter[
|
|
|
186
182
|
"""
|
|
187
183
|
hidden = self._hidden_scopes(item.get("scope") for item in items)
|
|
188
184
|
filtered: list[ValidationItem] = [
|
|
189
|
-
{**item, "allowed": False} if item.get("scope") in hidden else item
|
|
190
|
-
for item in items
|
|
185
|
+
{**item, "allowed": False} if item.get("scope") in hidden else item for item in items
|
|
191
186
|
]
|
|
192
187
|
return filtered, []
|
|
193
188
|
|
{openedx_authz-3.1.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/course_authoring/views.py
RENAMED
|
@@ -46,6 +46,6 @@ class WaffleFlagStatesAPIView(APIView):
|
|
|
46
46
|
try:
|
|
47
47
|
data = get_waffle_flag_states()
|
|
48
48
|
return Response(data, status=status.HTTP_200_OK)
|
|
49
|
-
except Exception as e:
|
|
49
|
+
except Exception as e: # pylint: disable=broad-exception-caught
|
|
50
50
|
logger.exception("Error getting waffle flag states: %s", e)
|
|
51
51
|
return Response({"message": "error"}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
|
|
@@ -1057,9 +1057,7 @@ class TestRoleAssignmentAPI(RolesTestSetupMixin):
|
|
|
1057
1057
|
[
|
|
1058
1058
|
RoleAssignmentData(
|
|
1059
1059
|
subject=SubjectData(external_key="alice"),
|
|
1060
|
-
roles=[
|
|
1061
|
-
RoleData(external_key=roles.LIBRARY_ADMIN.external_key)
|
|
1062
|
-
],
|
|
1060
|
+
roles=[RoleData(external_key=roles.LIBRARY_ADMIN.external_key)],
|
|
1063
1061
|
scope=ScopeData(external_key="lib:Org1:math_101"),
|
|
1064
1062
|
)
|
|
1065
1063
|
],
|
|
@@ -1069,9 +1067,7 @@ class TestRoleAssignmentAPI(RolesTestSetupMixin):
|
|
|
1069
1067
|
[
|
|
1070
1068
|
RoleAssignmentData(
|
|
1071
1069
|
subject=SubjectData(external_key="bob"),
|
|
1072
|
-
roles=[
|
|
1073
|
-
RoleData(external_key=roles.LIBRARY_AUTHOR.external_key)
|
|
1074
|
-
],
|
|
1070
|
+
roles=[RoleData(external_key=roles.LIBRARY_AUTHOR.external_key)],
|
|
1075
1071
|
scope=ScopeData(external_key="lib:Org1:history_201"),
|
|
1076
1072
|
)
|
|
1077
1073
|
],
|
|
@@ -1081,9 +1077,7 @@ class TestRoleAssignmentAPI(RolesTestSetupMixin):
|
|
|
1081
1077
|
[
|
|
1082
1078
|
RoleAssignmentData(
|
|
1083
1079
|
subject=SubjectData(external_key="carol"),
|
|
1084
|
-
roles=[
|
|
1085
|
-
RoleData(external_key=roles.LIBRARY_CONTRIBUTOR.external_key)
|
|
1086
|
-
],
|
|
1080
|
+
roles=[RoleData(external_key=roles.LIBRARY_CONTRIBUTOR.external_key)],
|
|
1087
1081
|
scope=ScopeData(external_key="lib:Org1:science_301"),
|
|
1088
1082
|
)
|
|
1089
1083
|
],
|
|
@@ -1093,9 +1087,7 @@ class TestRoleAssignmentAPI(RolesTestSetupMixin):
|
|
|
1093
1087
|
[
|
|
1094
1088
|
RoleAssignmentData(
|
|
1095
1089
|
subject=SubjectData(external_key="dave"),
|
|
1096
|
-
roles=[
|
|
1097
|
-
RoleData(external_key=roles.LIBRARY_USER.external_key)
|
|
1098
|
-
],
|
|
1090
|
+
roles=[RoleData(external_key=roles.LIBRARY_USER.external_key)],
|
|
1099
1091
|
scope=ScopeData(external_key="lib:Org1:english_101"),
|
|
1100
1092
|
)
|
|
1101
1093
|
],
|
|
@@ -266,9 +266,7 @@ class TestUserRoleAssignments(UserAssignmentsSetupMixin):
|
|
|
266
266
|
[
|
|
267
267
|
RoleAssignmentData(
|
|
268
268
|
subject=UserData(external_key="alice"),
|
|
269
|
-
roles=[
|
|
270
|
-
RoleData(external_key=roles.LIBRARY_ADMIN.external_key)
|
|
271
|
-
],
|
|
269
|
+
roles=[RoleData(external_key=roles.LIBRARY_ADMIN.external_key)],
|
|
272
270
|
scope=ContentLibraryData(external_key="lib:Org1:math_101"),
|
|
273
271
|
),
|
|
274
272
|
],
|
|
@@ -278,9 +276,7 @@ class TestUserRoleAssignments(UserAssignmentsSetupMixin):
|
|
|
278
276
|
[
|
|
279
277
|
RoleAssignmentData(
|
|
280
278
|
subject=UserData(external_key="bob"),
|
|
281
|
-
roles=[
|
|
282
|
-
RoleData(external_key=roles.LIBRARY_AUTHOR.external_key)
|
|
283
|
-
],
|
|
279
|
+
roles=[RoleData(external_key=roles.LIBRARY_AUTHOR.external_key)],
|
|
284
280
|
scope=ContentLibraryData(external_key="lib:Org1:history_201"),
|
|
285
281
|
),
|
|
286
282
|
],
|
|
@@ -290,9 +286,7 @@ class TestUserRoleAssignments(UserAssignmentsSetupMixin):
|
|
|
290
286
|
[
|
|
291
287
|
RoleAssignmentData(
|
|
292
288
|
subject=UserData(external_key="eve"),
|
|
293
|
-
roles=[
|
|
294
|
-
RoleData(external_key=roles.LIBRARY_ADMIN.external_key)
|
|
295
|
-
],
|
|
289
|
+
roles=[RoleData(external_key=roles.LIBRARY_ADMIN.external_key)],
|
|
296
290
|
scope=ContentLibraryData(external_key="lib:Org2:physics_401"),
|
|
297
291
|
),
|
|
298
292
|
],
|
|
@@ -66,9 +66,7 @@ class TestBuiltinAppletDefinitions:
|
|
|
66
66
|
"""Compiled definitions expose their owning applet through source metadata."""
|
|
67
67
|
compiled = SchemaPipeline().compile()
|
|
68
68
|
|
|
69
|
-
assert compiled.roles["library_admin"].sources[0].module == (
|
|
70
|
-
"openedx_authz.applets.content_libraries.schema"
|
|
71
|
-
)
|
|
69
|
+
assert compiled.roles["library_admin"].sources[0].module == ("openedx_authz.applets.content_libraries.schema")
|
|
72
70
|
assert compiled.roles["course_admin"].sources[0].module == "openedx_authz.applets.course_team_roles.schema"
|
|
73
71
|
assert compiled.permissions["courses.view_course"].sources[0].module == (
|
|
74
72
|
"openedx_authz.applets.course_authoring.schema"
|
|
@@ -42,9 +42,14 @@ class TestInstructorDashboardPermissions(BaseRolesTestCase):
|
|
|
42
42
|
assign_role_to_user_in_scope("dashboard_admin", roles.COURSE_ADMIN.external_key, COURSE_KEY)
|
|
43
43
|
assign_role_to_user_in_scope("dashboard_staff", roles.COURSE_STAFF.external_key, COURSE_KEY)
|
|
44
44
|
|
|
45
|
-
@data(
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
@data(
|
|
46
|
+
*(
|
|
47
|
+
(username, permission, expected)
|
|
48
|
+
for (username, expected), permission in product(
|
|
49
|
+
USERS_WITH_EXPECTED_ACCESS, INSTRUCTOR_DASHBOARD_PERMISSIONS
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
)
|
|
48
53
|
@unpack
|
|
49
54
|
def test_course_team_roles_are_allowed_new_permissions(self, username, permission, expected_result):
|
|
50
55
|
"""Course Admin and Course Staff are allowed every new permission, and a user without a role is denied."""
|