Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ Change Log
Unreleased
**********

Changed
=======

* **Breaking change:** the ``icon`` field of permission categories, permissions, roles and role
extensions now takes an identifier from the Open edX AuthZ icon set instead of a Paragon icon
name (ADR 0039, which supersedes ADR 0029). Identifiers use lowercase snake case, and any other
value fails schema validation, so update the schema files of plugins and deployments before
upgrading: for example, ``RemoveRedEye`` becomes ``remove_red_eye``. The role catalog returns
the new identifiers, so clients must map them to their own icons. The built-in schema files use
the new identifiers, and the copied Paragon list, its generator script and the
``paragon_icons`` and ``paragon_icons_check`` make targets are removed.

Added
=====

Expand Down
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: clean clean_tox compile_translations coverage diff_cover docs dummy_translations \
extract_translations fake_translations help pii_check pull_translations paragon_icons compiled_schema \
paragon_icons_check quality requirements selfcheck test test-all upgrade validate \
extract_translations fake_translations help pii_check pull_translations compiled_schema \
quality requirements selfcheck test test-all upgrade validate \
install_transifex_client

.DEFAULT_GOAL := help
Expand Down Expand Up @@ -37,12 +37,6 @@ upgrade: ## update the uv.lock file with the latest packages satisfying pyprojec
uv run --with edx-lint edx_lint write_uv_constraints pyproject.toml
uv lock --upgrade

paragon_icons: ## regenerate the vendored @openedx/paragon icon-name allow-list (see ADR 0029)
python scripts/generate_paragon_icons.py

paragon_icons_check: ## fail if the vendored Paragon icon list is out of date (CI)
python scripts/generate_paragon_icons.py --check

compiled_schema: ## regenerate the compiled schema snapshot in docs/references/compiled-schema.yaml
python scripts/generate_compiled_schema.py

Expand Down
7 changes: 7 additions & 0 deletions docs/decisions/0017-static-authorization-schema.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,10 @@ References
.. _Casbin adapters: https://v3.casbin.org/docs/adapters
.. _JSON Schema: https://json-schema.org/draft/2020-12/json-schema-core
.. _Paragon icons: https://paragon-openedx.netlify.app/components/icon/

Addendum: Open edX AuthZ Icon Set (2026-11-29)
**********************************************

`ADR 0039`_ amends the icon rules of this decision. ``icon`` values are no longer Paragon icon names: they are identifiers from the :ref:`Authorization Icon Set`, which ``openedx-authz`` owns. This replaces the Paragon icon name in section 2, the PascalCase ``icon`` values in the examples, and, in section 4, the icon validation rule and the sentence about Paragon renaming or removing an icon. Values outside the set still fail validation.

.. _ADR 0039: 0039-authz-icon-set.rst
7 changes: 7 additions & 0 deletions docs/decisions/0018-authorization-schema-lifecycle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,10 @@ References
.. _ADR 0016: 0016-static-and-dynamic-roles.rst
.. _ADR 0017: 0017-static-authorization-schema.rst
.. _ADR 0035: 0035-custom-role-persistence.rst

Addendum: Open edX AuthZ Icon Set (2026-11-29)
**********************************************

`ADR 0039`_ replaces the vendored Paragon icon names in step 5 of the validation phases. Semantic validation checks ``icon`` values against the :ref:`Authorization Icon Set`, which ``openedx-authz`` defines.

.. _ADR 0039: 0039-authz-icon-set.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,10 @@ References
.. _ADR 0017: 0017-static-authorization-schema.rst
.. _Maintaining translations on an Open edX repository: https://docs.openedx.org/en/latest/developers/how-tos/maintain-translations-in-your-repo.html
.. _Aspects translation extraction: https://github.com/openedx/tutor-contrib-aspects/blob/main/tutoraspects/translations/translate_utils.py

Addendum: Open edX AuthZ Icon Set (2026-11-29)
**********************************************

`ADR 0039`_ replaces Paragon icon names with identifiers from the :ref:`Authorization Icon Set`. These identifiers also keep the same value in every language.

.. _ADR 0039: 0039-authz-icon-set.rst
7 changes: 7 additions & 0 deletions docs/decisions/0028-api-contract-for-role-catalog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -447,3 +447,10 @@ This addendum amends the ``permissions``, ``roles`` and ``categories`` bullets o
.. _ADR 0025: 0025-authorization-schema-source-tracking.rst
.. _ADR 0029: 0029-paragon-icon-list-maintenance.rst
.. _ADR 0036: 0036-api-contract-for-custom-roles.rst

Addendum: 2026-11-29
********************

`ADR 0039`_ replaces Paragon icon names with identifiers from the :ref:`Authorization Icon Set`. This replaces the paragraph about icons under "Localization", and the ``icon`` values in the response example are now identifiers such as ``book_open``. The response format does not change: the API returns the stored identifier, or ``null``, and the client maps it to an icon.

.. _ADR 0039: 0039-authz-icon-set.rst
9 changes: 8 additions & 1 deletion docs/decisions/0029-paragon-icon-list-maintenance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Status
******

**Draft**
**Superseded** by `ADR 0039`_

Context
*******
Expand Down Expand Up @@ -86,3 +86,10 @@ References
.. _ADR 0017: 0017-static-authorization-schema.rst
.. _Paragon icons: https://paragon-openedx.netlify.app/components/icon/
.. _frontend-app-admin-console: https://github.com/openedx/frontend-app-admin-console

Addendum: Superseded (2026-11-29)
*********************************

`ADR 0039`_ supersedes this decision. ``openedx-authz`` now validates ``icon`` values against its own icon set. The copied Paragon list, the generator script, and the ``paragon_icons`` and ``paragon_icons_check`` make targets described above have been removed.

.. _ADR 0039: 0039-authz-icon-set.rst
103 changes: 103 additions & 0 deletions docs/decisions/0039-authz-icon-set.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
0039: Define an Open edX AuthZ Icon Set
########################################

Status
******

**Draft**

Supersedes `ADR 0029`_ and amends the icon rules of `ADR 0017`_, `ADR 0018`_, `ADR 0020`_ and `ADR 0028`_.

Context
*******

Permission categories, permissions, roles, and role extensions each have an optional ``icon`` field. `ADR 0017`_ §4 requires it to be a name exported by ``@openedx/paragon/icons``, and `ADR 0029`_ validates it against a generated copy of that list, taken from the Paragon version that ``frontend-app-admin-console`` declares.

This has two problems:

* **The backend is coupled to a frontend presentation library.** An icon renamed or removed in Paragon changes which schema files are valid, and keeping the copied list current needs a script, a pinned version, and a change in two repositories.
* **No repository decides which Paragon version a site uses.** Paragon is a peer dependency of ``frontend-base``, and each operator's site picks its version. A list taken from the admin console cannot guarantee that a valid icon can be rendered on a given site.

Schema files are also written outside this repository, by applications, plugins, and site operators, so the allowed values need to be stable and documented for them.

Decision
********

1. This repository owns the icon set
====================================

``openedx-authz`` defines a fixed set of icon identifiers in ``openedx_authz.constants.icons.AUTHZ_ICONS``. An identifier names an icon the authorization framework supports. It does not name a component in any library, and it does not have to match a Paragon name.

The first version of the set is the icon proposal for Open edX: the icons used for roles and permissions, plus the essential and recommended general icons.

2. Identifiers use lowercase snake case
=======================================

Identifiers match ``^[a-z][a-z0-9]*(_[a-z0-9]+)*$``, such as ``arrow_back`` or ``lms_book``. This follows the style of the other identifiers in the schema, and it makes a Paragon component name easy to tell apart from an identifier. Library-specific naming, such as the ``Icon`` suffix in ``MenuIcon``, is left out.

3. Unknown values fail validation
=================================

The JSON Schema checks the format of an ``icon`` value, and semantic validation checks that it belongs to the set. Both report an error, which stops the deployment, as unknown Paragon names did before. A warning would let a misspelled value reach the database and show up only as a default icon in the user interface.

4. The set is part of the extension API
=======================================

The set is documented in the :ref:`Authorization Icon Set` reference, and a test keeps that page and the constant in step. Adding an identifier is a compatible change. Removing or renaming one is a breaking change.

5. Clients map identifiers to icons
===================================

The API returns the identifier as written. Each client maps it to the icon it renders and shows a default icon when it has no mapping or the mapped icon is not available. For the admin console, that mapping and its tests live in ``frontend-app-admin-console``.

6. No new schema version
========================

``schema_version`` stays ``1.0``. The change is released as a breaking change instead, so schema files written with Paragon names must be updated.

Consequences
************

* Icon validation no longer depends on Paragon. The copied Paragon list, its generator script, and the ``paragon_icons`` and ``paragon_icons_check`` make targets are removed.
* **Breaking change:** a schema file that uses a Paragon name, such as ``RemoveRedEye``, fails validation. Plugin authors and operators must replace it with an identifier from the set, such as ``remove_red_eye``, before deploying.
* The built-in schema files use the new identifiers. The next deployment updates the stored icon of each built-in definition.
* A Paragon upgrade can no longer change which schema files are valid. It can only affect a client's mapping, where a missing icon falls back to the default.
* A new icon needs a change in this repository and a mapping in each client. Until a client adds the mapping, it shows the default icon.
* The set is limited. Extension authors cannot use an icon that is not in it.

Rejected Alternatives
*********************

Keep Paragon names and automate the list update
===============================================

A scheduled job could refresh the copied list (`Pull request #537`_). It would keep both problems described above.

Accept any string
=================

Dropping the check would remove the coupling, but typos would go unnoticed and clients could not know which values to support.

Report unknown values as warnings
=================================

Upgrades would be easier for existing schema files, but the set would stop being a reliable contract for clients.

References
**********

* `ADR 0017`_
* `ADR 0018`_
* `ADR 0020`_
* `ADR 0028`_
* `ADR 0029`_
* `Issue #651`_
* `Pull request #537`_

.. _ADR 0017: 0017-static-authorization-schema.rst
.. _ADR 0018: 0018-authorization-schema-lifecycle.rst
.. _ADR 0020: 0020-authorization-schema-internationalization.rst
.. _ADR 0028: 0028-api-contract-for-role-catalog.rst
.. _ADR 0029: 0029-paragon-icon-list-maintenance.rst
.. _Issue #651: https://github.com/openedx/openedx-authz/issues/651
.. _Pull request #537: https://github.com/openedx/openedx-authz/pull/537
18 changes: 9 additions & 9 deletions docs/references/authorization-schema.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Each schema version has a downloadable authz JSON Schema that describes its fiel

You can also :doc:`browse the generated schema <authorization-schema-json>`. Editors and validation tools can use these files to check YAML files because JSON Schema applies to the data represented by both JSON and YAML.

The JSON Schema checks the structure of one file. The compiler also checks references across the combined schema, registered scope namespaces, available Paragon icons, and conflicts between contributions.
The JSON Schema checks the structure of one file. The compiler also checks references across the combined schema, registered scope namespaces, the :ref:`Authorization Icon Set`, and conflicts between contributions.

Complete example
****************
Expand All @@ -42,7 +42,7 @@ The following file defines one category, two permissions, one role, and an exten
- id: course_content
display_name: Course content
description: Permissions for viewing and editing course content.
icon: Article
icon: article

permissions:
- namespace: courses
Expand All @@ -52,7 +52,7 @@ The following file defines one category, two permissions, one role, and an exten
category_id: course_content
scopes:
- course-v1
icon: Visibility
icon: visibility

- namespace: courses
name: view_course_updates
Expand All @@ -61,7 +61,7 @@ The following file defines one category, two permissions, one role, and an exten
category_id: course_content
scopes:
- course-v1
icon: Visibility
icon: visibility

roles:
- id: course_observer
Expand Down Expand Up @@ -130,7 +130,7 @@ A category contains these fields:
A complete source-language sentence describing the group of permissions.

``icon``
An optional icon name exported by ``@openedx/paragon/icons``. The value is case-sensitive, such as ``Article``.
An optional identifier from the :ref:`Authorization Icon Set`, such as ``article``.

``hidden``
An optional boolean that defaults to ``false``. A hidden category does not appear in normal discovery and selection interfaces, and neither do the permissions it contains. Hiding does not delete the category or its permissions, remove them from roles, or change permission checks. Role extensions cannot change this field.
Expand All @@ -143,7 +143,7 @@ For example:
- id: library_management
display_name: Library management
description: Permissions for managing content libraries.
icon: Article
icon: article

Permissions
***********
Expand All @@ -169,7 +169,7 @@ A permission contains these fields:
The scope namespaces where the permission can apply. These values come from registered ``ScopeData`` types, such as ``course-v1``, ``ccx-v1``, or ``lib``.

``icon``
An optional, case-sensitive icon name exported by ``@openedx/paragon/icons``.
An optional identifier from the :ref:`Authorization Icon Set`.

``hidden``
An optional boolean that defaults to ``false``. A hidden permission does not appear in normal discovery and selection interfaces or in role details. Hiding does not delete the permission, remove it from roles, or change permission checks. Role extensions cannot change this field.
Expand Down Expand Up @@ -250,7 +250,7 @@ A role contains these fields:
A list of complete permission IDs. The role lists every permission it needs, including every direct and indirect dependency of those permissions (see `Permission dependencies`_).

``icon``
An optional, case-sensitive icon name exported by ``@openedx/paragon/icons``.
An optional identifier from the :ref:`Authorization Icon Set`.

``hidden``
An optional boolean that defaults to ``false``. A hidden role does not appear in normal role discovery and selection interfaces. Hiding does not delete the role, remove existing assignments, or change permission checks.
Expand All @@ -268,7 +268,7 @@ For example:
permissions:
- content_libraries.view_library
- content_libraries.view_library_team
icon: Visibility
icon: visibility

The Casbin form ``role^library_reviewer`` is an internal value and is not valid as ``roles.id`` or in a ``role_extensions.role_id`` reference.

Expand Down
Loading