diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 62d726518..ef2567019 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 ===== diff --git a/Makefile b/Makefile index 95e26f28f..9e61d300c 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/docs/decisions/0017-static-authorization-schema.rst b/docs/decisions/0017-static-authorization-schema.rst index 1c45dcd92..edb2ee9fd 100644 --- a/docs/decisions/0017-static-authorization-schema.rst +++ b/docs/decisions/0017-static-authorization-schema.rst @@ -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 diff --git a/docs/decisions/0018-authorization-schema-lifecycle.rst b/docs/decisions/0018-authorization-schema-lifecycle.rst index ca2c2693e..023a23604 100644 --- a/docs/decisions/0018-authorization-schema-lifecycle.rst +++ b/docs/decisions/0018-authorization-schema-lifecycle.rst @@ -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 diff --git a/docs/decisions/0020-authorization-schema-internationalization.rst b/docs/decisions/0020-authorization-schema-internationalization.rst index 69f5e51b0..eced9d1d8 100644 --- a/docs/decisions/0020-authorization-schema-internationalization.rst +++ b/docs/decisions/0020-authorization-schema-internationalization.rst @@ -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 diff --git a/docs/decisions/0028-api-contract-for-role-catalog.rst b/docs/decisions/0028-api-contract-for-role-catalog.rst index 7b369c3bd..0ab1f1a02 100644 --- a/docs/decisions/0028-api-contract-for-role-catalog.rst +++ b/docs/decisions/0028-api-contract-for-role-catalog.rst @@ -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 diff --git a/docs/decisions/0029-paragon-icon-list-maintenance.rst b/docs/decisions/0029-paragon-icon-list-maintenance.rst index 85fb4a259..b49967e81 100644 --- a/docs/decisions/0029-paragon-icon-list-maintenance.rst +++ b/docs/decisions/0029-paragon-icon-list-maintenance.rst @@ -4,7 +4,7 @@ Status ****** -**Draft** +**Superseded** by `ADR 0039`_ Context ******* @@ -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 diff --git a/docs/decisions/0039-authz-icon-set.rst b/docs/decisions/0039-authz-icon-set.rst new file mode 100644 index 000000000..af63fcecc --- /dev/null +++ b/docs/decisions/0039-authz-icon-set.rst @@ -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 diff --git a/docs/references/authorization-schema.rst b/docs/references/authorization-schema.rst index e075dee33..f1cb7c921 100644 --- a/docs/references/authorization-schema.rst +++ b/docs/references/authorization-schema.rst @@ -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 `. 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 **************** @@ -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 @@ -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 @@ -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 @@ -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. @@ -143,7 +143,7 @@ For example: - id: library_management display_name: Library management description: Permissions for managing content libraries. - icon: Article + icon: article Permissions *********** @@ -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. @@ -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. @@ -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. diff --git a/docs/references/compiled-schema.yaml b/docs/references/compiled-schema.yaml index f969de4e6..103911bb4 100644 --- a/docs/references/compiled-schema.yaml +++ b/docs/references/compiled-schema.yaml @@ -287,7 +287,7 @@ permissions: category_id: library_collection scopes: - lib - icon: Plus + icon: add hidden: false depends_on: - content_libraries.edit_library_collection @@ -300,7 +300,7 @@ permissions: category_id: library scopes: - lib - icon: Delete + icon: delete hidden: false depends_on: - content_libraries.edit_library_content @@ -313,7 +313,7 @@ permissions: category_id: library_collection scopes: - lib - icon: Delete + icon: delete hidden: false depends_on: - content_libraries.edit_library_collection @@ -326,7 +326,7 @@ permissions: category_id: library_collection scopes: - lib - icon: EditOutline + icon: edit_outline hidden: false depends_on: - content_libraries.view_library @@ -339,7 +339,7 @@ permissions: category_id: library_content scopes: - lib - icon: EditOutline + icon: edit_outline hidden: false depends_on: - content_libraries.view_library @@ -352,7 +352,7 @@ permissions: category_id: library scopes: - lib - icon: Settings + icon: settings hidden: false depends_on: - content_libraries.edit_library_content @@ -365,7 +365,7 @@ permissions: category_id: library_team scopes: - lib - icon: Settings + icon: settings hidden: false depends_on: - content_libraries.view_library_team @@ -378,7 +378,7 @@ permissions: category_id: library_content scopes: - lib - icon: DownloadDone + icon: download_done hidden: false depends_on: - content_libraries.edit_library_content @@ -392,7 +392,7 @@ permissions: category_id: library_content scopes: - lib - icon: SpinnerIcon + icon: spinner hidden: false depends_on: - content_libraries.view_library @@ -405,7 +405,7 @@ permissions: category_id: library scopes: - lib - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] content_libraries.view_library_team: @@ -417,7 +417,7 @@ permissions: category_id: library_team scopes: - lib - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.create_files: @@ -429,7 +429,7 @@ permissions: category_id: course_files scopes: - course-v1 - icon: Plus + icon: add hidden: false depends_on: [] courses.delete_files: @@ -441,7 +441,7 @@ permissions: category_id: course_files scopes: - course-v1 - icon: Delete + icon: delete hidden: false depends_on: [] courses.edit_course_content: @@ -453,7 +453,7 @@ permissions: category_id: course_access_content scopes: - course-v1 - icon: EditOutline + icon: edit_outline hidden: false depends_on: [] courses.edit_details: @@ -465,7 +465,7 @@ permissions: category_id: course_schedule_details scopes: - course-v1 - icon: EditOutline + icon: edit_outline hidden: false depends_on: [] courses.edit_files: @@ -477,7 +477,7 @@ permissions: category_id: course_files scopes: - course-v1 - icon: EditOutline + icon: edit_outline hidden: false depends_on: [] courses.edit_grading_settings: @@ -489,7 +489,7 @@ permissions: category_id: course_grading_settings scopes: - course-v1 - icon: EditOutline + icon: edit_outline hidden: false depends_on: [] courses.edit_schedule: @@ -501,7 +501,7 @@ permissions: category_id: course_schedule_details scopes: - course-v1 - icon: EditOutline + icon: edit_outline hidden: false depends_on: [] courses.enroll_learners: @@ -513,7 +513,7 @@ permissions: category_id: course_enrollments scopes: - course-v1 - icon: PersonAdd + icon: person_add hidden: false depends_on: [] courses.export_course: @@ -525,7 +525,7 @@ permissions: category_id: course_import_export scopes: - course-v1 - icon: Upload + icon: arrow_upward hidden: false depends_on: [] courses.export_tags: @@ -537,7 +537,7 @@ permissions: category_id: course_tags_taxonomies scopes: - course-v1 - icon: Upload + icon: arrow_upward hidden: false depends_on: [] courses.import_course: @@ -549,7 +549,7 @@ permissions: category_id: course_import_export scopes: - course-v1 - icon: Download + icon: arrow_downward hidden: false depends_on: [] courses.legacy_beta_tester_permissions: @@ -561,7 +561,7 @@ permissions: category_id: course_legacy scopes: - course-v1 - icon: DrawShapes + icon: draw_shapes hidden: false depends_on: [] courses.legacy_data_researcher_permissions: @@ -573,7 +573,7 @@ permissions: category_id: course_legacy scopes: - course-v1 - icon: DrawShapes + icon: draw_shapes hidden: false depends_on: [] courses.legacy_instructor_role_permissions: @@ -585,7 +585,7 @@ permissions: category_id: course_legacy scopes: - course-v1 - icon: DrawShapes + icon: draw_shapes hidden: false depends_on: [] courses.legacy_limited_staff_role_permissions: @@ -597,7 +597,7 @@ permissions: category_id: course_legacy scopes: - course-v1 - icon: DrawShapes + icon: draw_shapes hidden: false depends_on: [] courses.legacy_staff_role_permissions: @@ -609,7 +609,7 @@ permissions: category_id: course_legacy scopes: - course-v1 - icon: DrawShapes + icon: draw_shapes hidden: false depends_on: [] courses.manage_advanced_settings: @@ -621,7 +621,7 @@ permissions: category_id: course_advanced_settings_certificates scopes: - course-v1 - icon: Settings + icon: settings hidden: false depends_on: [] courses.manage_bulk_learner_grading: @@ -633,7 +633,7 @@ permissions: category_id: course_learner_grading scopes: - course-v1 - icon: Settings + icon: settings hidden: false depends_on: - courses.manage_learner_grading @@ -646,7 +646,7 @@ permissions: category_id: course_advanced_settings_certificates scopes: - course-v1 - icon: Settings + icon: settings hidden: false depends_on: [] courses.manage_cohorts: @@ -658,7 +658,7 @@ permissions: category_id: course_cohorts_content_groups scopes: - course-v1 - icon: Settings + icon: settings hidden: false depends_on: [] courses.manage_course_team: @@ -670,7 +670,7 @@ permissions: category_id: course_team scopes: - course-v1 - icon: Settings + icon: settings hidden: false depends_on: [] courses.manage_course_updates: @@ -682,7 +682,7 @@ permissions: category_id: course_updates_handouts scopes: - course-v1 - icon: Settings + icon: settings hidden: false depends_on: [] courses.manage_group_configurations: @@ -694,7 +694,7 @@ permissions: category_id: course_cohorts_content_groups scopes: - course-v1 - icon: Settings + icon: settings hidden: false depends_on: [] courses.manage_learner_extensions: @@ -706,7 +706,7 @@ permissions: category_id: course_learner_extensions scopes: - course-v1 - icon: Settings + icon: settings hidden: false depends_on: - courses.view_learner_course_status @@ -719,7 +719,7 @@ permissions: category_id: course_learner_grading scopes: - course-v1 - icon: Settings + icon: settings hidden: false depends_on: - courses.view_learner_course_status @@ -732,7 +732,7 @@ permissions: category_id: course_library_updates scopes: - course-v1 - icon: Checklist + icon: checklist hidden: false depends_on: [] courses.manage_pages_and_resources: @@ -744,7 +744,7 @@ permissions: category_id: course_pages_resources scopes: - course-v1 - icon: Settings + icon: settings hidden: false depends_on: [] courses.manage_tags: @@ -756,7 +756,7 @@ permissions: category_id: course_tags_taxonomies scopes: - course-v1 - icon: Settings + icon: settings hidden: false depends_on: [] courses.manage_taxonomies: @@ -768,7 +768,7 @@ permissions: category_id: course_tags_taxonomies scopes: - course-v1 - icon: LocalOffer + icon: tag hidden: true depends_on: [] courses.publish_course_content: @@ -780,7 +780,7 @@ permissions: category_id: course_access_content scopes: - course-v1 - icon: DownloadDone + icon: download_done hidden: false depends_on: [] courses.unenroll_learners: @@ -792,7 +792,7 @@ permissions: category_id: course_enrollments scopes: - course-v1 - icon: PersonRemove + icon: person_remove hidden: false depends_on: [] courses.view_advanced_settings: @@ -804,7 +804,7 @@ permissions: category_id: course_advanced_settings_certificates scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_certificates: @@ -816,7 +816,7 @@ permissions: category_id: course_advanced_settings_certificates scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_checklists: @@ -828,7 +828,7 @@ permissions: category_id: course_access_content scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_cohorts: @@ -840,7 +840,7 @@ permissions: category_id: course_cohorts_content_groups scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_course: @@ -852,7 +852,7 @@ permissions: category_id: course_access_content scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_course_info: @@ -864,7 +864,7 @@ permissions: category_id: course_access_content scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_course_team: @@ -876,7 +876,7 @@ permissions: category_id: course_team scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_course_updates: @@ -888,7 +888,7 @@ permissions: category_id: course_updates_handouts scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_enrollments: @@ -900,7 +900,7 @@ permissions: category_id: course_enrollments scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_files: @@ -912,7 +912,7 @@ permissions: category_id: course_files scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_gradebook: @@ -924,7 +924,7 @@ permissions: category_id: course_learner_grading scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: - courses.view_course_info @@ -937,7 +937,7 @@ permissions: category_id: course_grading_settings scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_group_configurations: @@ -949,7 +949,7 @@ permissions: category_id: course_cohorts_content_groups scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_learner_course_status: @@ -961,7 +961,7 @@ permissions: category_id: course_access_content scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_learner_extensions: @@ -973,7 +973,7 @@ permissions: category_id: course_learner_extensions scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_library_updates: @@ -985,7 +985,7 @@ permissions: category_id: course_library_updates scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_pages_and_resources: @@ -997,7 +997,7 @@ permissions: category_id: course_pages_resources scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] courses.view_schedule_and_details: @@ -1009,7 +1009,7 @@ permissions: category_id: course_schedule_details scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye hidden: false depends_on: [] categories: @@ -1017,119 +1017,119 @@ categories: applet: course_authoring display_name: Course access & content description: Permissions for accessing the course, viewing course and learner information, and managing course content. - icon: BookOpen + icon: book_open hidden: false course_advanced_settings_certificates: applet: course_authoring display_name: Advanced settings & certificates description: Permissions for viewing and managing advanced course settings and course certificates in Studio. - icon: CheckCircle + icon: check_circle hidden: false course_cohorts_content_groups: applet: learner_administration display_name: Cohorts & content groups description: Permissions for organizing learners into cohorts in the Instructor Dashboard and configuring content groups in Studio. - icon: Groups + icon: groups hidden: false course_enrollments: applet: enrollments display_name: Enrollments description: Permissions for viewing and managing learner enrollments in the Instructor Dashboard. - icon: People + icon: people hidden: false course_files: applet: course_authoring display_name: Files description: Permissions for viewing and managing files and assets uploaded to the course. - icon: Folder + icon: folder hidden: false course_grading_settings: applet: course_authoring display_name: Grading settings description: Permissions for viewing and editing course grading settings. - icon: Award + icon: award hidden: false course_import_export: applet: course_authoring display_name: Course import & export description: Permissions for importing and exporting course content. - icon: Download + icon: download hidden: false course_learner_extensions: applet: learner_administration display_name: Learner extensions description: Permissions for viewing and managing individual learner extensions in the Instructor Dashboard. - icon: Event + icon: event hidden: false course_learner_grading: applet: learner_grading display_name: Learner grading description: Permissions for viewing learner grades and using grading tools in the Instructor Dashboard. - icon: Grading + icon: grading hidden: false course_legacy: applet: course_team_roles display_name: Legacy compatibility description: Internal compatibility permissions that map legacy course roles to the authorization system. Not shown as individually assignable permissions. - icon: DrawShapes + icon: draw_shapes hidden: true course_library_updates: applet: course_authoring display_name: Library updates description: Permissions for reviewing and applying content updates from linked libraries. - icon: LibraryBooks + icon: library_books hidden: false course_pages_resources: applet: course_authoring display_name: Pages & resources description: Permissions for viewing and managing course pages and additional learning resources. - icon: Article + icon: article hidden: false course_schedule_details: applet: course_authoring display_name: Schedule & details description: Permissions for viewing and editing the course schedule and details in Studio. - icon: Calendar + icon: calendar hidden: false course_tags_taxonomies: applet: course_authoring display_name: Tags description: Permissions for managing course tags and exporting tag data. - icon: LocalOffer + icon: tag hidden: false course_team: applet: course_authoring display_name: Course team description: Permissions for viewing course team members and managing course role assignments. - icon: Group + icon: group hidden: false course_updates_handouts: applet: course_authoring display_name: Course updates & handouts description: Permissions for viewing and managing course announcements and handouts. - icon: Sync + icon: sync hidden: false library: applet: content_libraries display_name: Library description: Permissions related to viewing, managing, and publishing the library structure and metadata. - icon: CollectionsBookmark + icon: collections_bookmark hidden: false library_collection: applet: content_libraries display_name: Collection description: Permissions for creating and managing content collections within the library. - icon: AutoAwesomeMosaic + icon: auto_awesome_mosaic hidden: false library_content: applet: content_libraries display_name: Content description: Permissions for editing, publishing, and reusing content within the library. - icon: Notes + icon: notes hidden: false library_team: applet: content_libraries display_name: Team description: Permissions for viewing and managing users who have access to the library. - icon: Group + icon: group hidden: false diff --git a/docs/references/icons.rst b/docs/references/icons.rst new file mode 100644 index 000000000..26fcdb9ef --- /dev/null +++ b/docs/references/icons.rst @@ -0,0 +1,602 @@ +.. _Authorization Icon Set: + +Authorization Icon Set +###################### + +The ``icon`` field of permission categories, permissions, roles, and role extensions in the :ref:`Authorization Schema Reference` accepts only the identifiers listed on this page (:doc:`ADR 0039 `). The set is part of the extension API, so schema files from applications, plugins, and site operators use the same identifiers as the built-in files. Validation rejects any other value. + +``openedx-authz`` owns these identifiers, and they do not depend on an icon library. The API returns the identifier as written, and each client decides which icon to draw for it. A client that has no icon for an identifier shows a default icon. + +Each table lists what an identifier represents in the authorization framework, and an example of the icon that ``@openedx/paragon/icons`` provides for it. The example is a reference for client implementations, which can draw a different icon. + +The same values are available in Python as ``openedx_authz.constants.icons.AUTHZ_ICONS``. + +.. contents:: Contents + :depth: 1 + :local: + +Roles and permissions +********************* + +.. list-table:: + :header-rows: 1 + :widths: 30 45 25 + + * - Identifier + - Represents + - Paragon example + * - ``institution`` + - An organization, covering all of its courses and libraries + - ``AccountBalance`` + * - ``person`` + - A single user + - ``Person`` + * - ``place`` + - A location or scope filter + - ``LocationOn`` + * - ``add`` + - Permission to create or add something, such as a role assignment + - ``Plus`` + * - ``school`` + - A course or a set of courses + - ``School`` + * - ``language`` + - All organizations (global) + - ``Language`` + * - ``library_books`` + - A library, or library updates in a course + - ``LibraryBooks`` + * - ``collections_bookmark`` + - A library as a collection of content + - ``CollectionsBookmark`` + * - ``remove_red_eye`` + - Read-only access to view something + - ``RemoveRedEye`` + * - ``book_open`` + - Courses and course content + - ``BookOpen`` + * - ``edit_outline`` + - Permission to edit or change something + - ``EditOutline`` + * - ``edit`` + - Permission to edit, in a stronger variant than ``edit_outline`` + - ``Edit`` + * - ``download_done`` + - Permission to publish or finalize content + - ``DownloadDone`` + * - ``checklist`` + - Checklists and completion requirements + - ``Checklist`` + * - ``spinner`` + - Processing or in-progress operations + - ``SpinnerIcon`` + * - ``settings`` + - Permission to manage or configure something + - ``Settings`` + * - ``description`` + - Documents and details + - ``Description`` + * - ``folder`` + - Files and file collections + - ``Folder`` + * - ``delete`` + - Permission to delete something + - ``Delete`` + * - ``calendar`` + - Dates and schedules + - ``Calendar`` + * - ``event`` + - A single date or deadline, such as an extension + - ``Event`` + * - ``award`` + - Grading and certificates + - ``Award`` + * - ``people`` + - Several users or a team + - ``People`` + * - ``group`` + - A single group, such as a team + - ``Group`` + * - ``tag`` + - Tags and taxonomies + - ``LocalOffer`` + * - ``verified`` + - Verified or approved items + - ``Verified`` + * - ``download`` + - Permission to download + - ``Download`` + * - ``arrow_downward`` + - Permission to import + - ``ArrowDownward`` + * - ``arrow_upward`` + - Permission to export + - ``ArrowUpward`` + * - ``draw_shapes`` + - Legacy role permissions + - ``DrawShapes`` + * - ``program`` + - Programs + - ``Program`` + * - ``text_snippet`` + - Text content + - ``TextSnippet`` + * - ``auto_awesome_mosaic`` + - Grouped content or blocks + - ``AutoAwesomeMosaic`` + +Navigation +********** + +.. list-table:: + :header-rows: 1 + :widths: 30 45 25 + + * - Identifier + - Represents + - Paragon example + * - ``arrow_back`` + - Return to a previous step + - ``ArrowBack`` + * - ``arrow_forward`` + - Continue to a next step + - ``ArrowForward`` + * - ``chevron_left`` + - Previous page or collapsed side panel + - ``ChevronLeft`` + * - ``chevron_right`` + - Next page or navigable item + - ``ChevronRight`` + * - ``expand_more`` + - Expandable section + - ``ExpandMore`` + * - ``expand_less`` + - Collapsible section + - ``ExpandLess`` + * - ``arrow_drop_down`` + - Drop-down selection + - ``ArrowDropDown`` + * - ``home`` + - The home or dashboard area + - ``Home`` + * - ``menu`` + - A menu of options + - ``MenuIcon`` + * - ``more_vert`` + - More actions on an item + - ``MoreVert`` + * - ``more_horiz`` + - More secondary actions + - ``MoreHoriz`` + * - ``open_in_new`` + - An external resource + - ``OpenInNew`` + * - ``close`` + - Dismiss or close + - ``Close`` + * - ``drag_indicator`` + - Reordering + - ``DragIndicator`` + * - ``logout`` + - Signing out + - ``Logout`` + * - ``arrow_drop_up`` + - Ascending order or an open drop-down + - ``ArrowDropUp`` + * - ``unfold_more`` + - Sortable without an order applied + - ``UnfoldMore`` + * - ``first_page`` + - The first page + - ``FirstPage`` + * - ``last_page`` + - The last page + - ``LastPage`` + * - ``fullscreen`` + - Full-screen view + - ``Fullscreen`` + * - ``fullscreen_exit`` + - Leaving full-screen view + - ``FullscreenExit`` + * - ``login`` + - Signing in + - ``Login`` + +Actions +******* + +.. list-table:: + :header-rows: 1 + :widths: 30 45 25 + + * - Identifier + - Represents + - Paragon example + * - ``add_circle_outline`` + - Permission to add an item, in a lighter variant + - ``AddCircleOutline`` + * - ``remove`` + - Permission to remove something + - ``Remove`` + * - ``delete_outline`` + - Permission to delete, in a lighter variant + - ``DeleteOutline`` + * - ``content_copy`` + - Permission to copy or duplicate something + - ``ContentCopy`` + * - ``save`` + - Permission to save changes + - ``Save`` + * - ``search`` + - Permission to search or discover items + - ``Search`` + * - ``check`` + - A confirmed or completed item + - ``Check`` + * - ``refresh`` + - Reloading or retrying + - ``Refresh`` + * - ``link`` + - Links to resources + - ``Link`` + * - ``upload`` + - Permission to upload + - ``Upload`` + * - ``filter_list`` + - Filtering items + - ``FilterList`` + * - ``sort`` + - Ordering items + - ``Sort`` + * - ``publish`` + - Permission to publish content + - ``Publish`` + * - ``visibility`` + - Items that are visible + - ``Visibility`` + * - ``visibility_off`` + - Items that are hidden + - ``VisibilityOff`` + * - ``add_circle`` + - Permission to add an item, in a prominent variant + - ``AddCircle`` + * - ``remove_circle_outline`` + - Permission to remove an item from a list or assignment + - ``RemoveCircleOutline`` + * - ``undo`` + - Reverting a change + - ``Undo`` + * - ``redo`` + - Reapplying a change + - ``Redo`` + * - ``share`` + - Permission to share something + - ``Share`` + * - ``tune`` + - Advanced settings + - ``Tune`` + * - ``print`` + - Permission to print + - ``Print`` + * - ``send`` + - Permission to send messages or invitations + - ``Send`` + * - ``archive`` + - Archived items + - ``Archive`` + * - ``block`` + - Blocked or denied access + - ``Block`` + +Status & feedback +***************** + +.. list-table:: + :header-rows: 1 + :widths: 30 45 25 + + * - Identifier + - Represents + - Paragon example + * - ``info`` + - Informational status + - ``Info`` + * - ``info_outline`` + - Informational status, in a lighter variant + - ``InfoOutline`` + * - ``warning`` + - A warning status + - ``Warning`` + * - ``error`` + - An error status + - ``Error`` + * - ``error_outline`` + - An error status, in a lighter variant + - ``ErrorOutline`` + * - ``check_circle`` + - A successful or active status + - ``CheckCircle`` + * - ``cancel`` + - A failed or rejected status + - ``Cancel`` + * - ``help_outline`` + - Help or support + - ``HelpOutline`` + * - ``access_time`` + - Durations and time of day + - ``AccessTime`` + * - ``check_circle_outline`` + - A completed status, in a lighter variant + - ``CheckCircleOutline`` + * - ``help`` + - Help, in a prominent variant + - ``Help`` + * - ``pending`` + - A pending status + - ``Pending`` + * - ``hourglass_empty`` + - Waiting or background processing + - ``HourglassEmpty`` + * - ``sync`` + - Synchronization with another system, such as library updates + - ``Sync`` + * - ``schedule`` + - A scheduled or future date + - ``Schedule`` + * - ``alarm`` + - Reminders and deadlines + - ``Alarm`` + +Users & access +************** + +.. list-table:: + :header-rows: 1 + :widths: 30 45 25 + + * - Identifier + - Represents + - Paragon example + * - ``account_circle`` + - A user account + - ``AccountCircle`` + * - ``person_add`` + - Adding a user, such as enrolling a learner + - ``PersonAdd`` + * - ``person_remove`` + - Removing a user from a role, team, or course + - ``PersonRemove`` + * - ``groups`` + - Several groups, such as cohorts or learner groups + - ``Groups`` + * - ``manage_accounts`` + - Managing users and their permissions + - ``ManageAccounts`` + * - ``admin_panel_settings`` + - Administration roles + - ``AdminPanelSettings`` + * - ``lock`` + - Restricted or locked access + - ``Lock`` + * - ``lock_open`` + - Unlocked access or access granted + - ``LockOpen`` + * - ``email`` + - Email and invitations + - ``Email`` + * - ``supervisor_account`` + - Staff and supervisory roles + - ``SupervisorAccount`` + * - ``security`` + - Security and access policies + - ``Security`` + * - ``verified_user`` + - A verified user or identity + - ``VerifiedUser`` + * - ``key`` + - Credentials and permissions + - ``Key`` + +Learning & content +****************** + +.. list-table:: + :header-rows: 1 + :widths: 30 45 25 + + * - Identifier + - Represents + - Paragon example + * - ``assignment`` + - Assignments, problems, and assessments + - ``Assignment`` + * - ``quiz`` + - Exams and quizzes + - ``Quiz`` + * - ``grading`` + - Grades and grading tools + - ``Grading`` + * - ``assessment`` + - Reports and analytics + - ``Assessment`` + * - ``article`` + - Pages and text content + - ``Article`` + * - ``videocam`` + - Video content + - ``Videocam`` + * - ``play_circle`` + - Playing media or starting a lesson + - ``PlayCircle`` + * - ``forum`` + - Discussions and forums + - ``Forum`` + * - ``extension`` + - XBlocks, plugins, and integrations + - ``Extension`` + * - ``workspace_premium`` + - Certificates and credentials + - ``WorkspacePremium`` + * - ``lms_book`` + - A reading unit in the course outline + - ``LmsBook`` + * - ``lms_videocam`` + - A video unit in the course outline + - ``LmsVideocam`` + * - ``lms_edit_square`` + - A problem unit in the course outline + - ``LmsEditSquare`` + * - ``lms_completion_solid`` + - A completed unit in the course outline + - ``LmsCompletionSolid`` + * - ``auto_stories`` + - Readings and study material + - ``AutoStories`` + * - ``book`` + - Textbooks + - ``Book`` + * - ``play_arrow`` + - Playing or resuming content + - ``PlayArrow`` + * - ``pause`` + - Pausing content + - ``Pause`` + * - ``question_answer`` + - Questions and answers + - ``QuestionAnswer`` + * - ``comment`` + - Comments + - ``Comment`` + * - ``notes`` + - Notes, annotations, and content items + - ``Notes`` + * - ``code`` + - Code or raw HTML content + - ``Code`` + * - ``translate`` + - Translations and transcripts + - ``Translate`` + * - ``accessibility`` + - Accessibility options + - ``Accessibility`` + +Files & data +************ + +.. list-table:: + :header-rows: 1 + :widths: 30 45 25 + + * - Identifier + - Represents + - Paragon example + * - ``insert_drive_file`` + - A generic file or asset + - ``InsertDriveFile`` + * - ``upload_file`` + - Permission to upload a file, such as a course import + - ``UploadFile`` + * - ``attach_file`` + - Attaching a file + - ``AttachFile`` + * - ``image`` + - Images + - ``ImageIcon`` + * - ``bar_chart`` + - Charts and statistics + - ``BarChart`` + * - ``folder_open`` + - An open folder or file browser + - ``FolderOpen`` + * - ``attachment`` + - An attached file, similar to ``attach_file`` + - ``Attachment`` + * - ``picture_as_pdf`` + - PDF documents + - ``PictureAsPdf`` + * - ``trending_up`` + - Progress or rising metrics + - ``TrendingUp`` + * - ``insights`` + - Analytics + - ``Insights`` + +Views & layout +************** + +.. list-table:: + :header-rows: 1 + :widths: 30 45 25 + + * - Identifier + - Represents + - Paragon example + * - ``dashboard`` + - A dashboard or main panel + - ``Dashboard`` + * - ``grid_view`` + - A grid view of items + - ``GridView`` + * - ``view_list`` + - A list view of items + - ``ViewList`` + * - ``list`` + - Lists or an index + - ``List`` + +Communication +************* + +.. list-table:: + :header-rows: 1 + :widths: 30 45 25 + + * - Identifier + - Represents + - Paragon example + * - ``notifications`` + - Notifications + - ``Notifications`` + * - ``notifications_off`` + - Notifications turned off + - ``NotificationsOff`` + * - ``announcement`` + - Course announcements and updates + - ``Announcement`` + +General +******* + +.. list-table:: + :header-rows: 1 + :widths: 30 45 25 + + * - Identifier + - Represents + - Paragon example + * - ``star`` + - Favorites (active) + - ``Star`` + * - ``star_border`` + - Favorites (inactive) + - ``StarBorder`` + * - ``bookmark`` + - Bookmarks (active) + - ``Bookmark`` + * - ``bookmark_border`` + - Bookmarks (inactive) + - ``BookmarkBorder`` + * - ``public`` + - Public or open content + - ``Public`` + * - ``bolt`` + - Quick actions and automations + - ``Bolt`` + * - ``lightbulb`` + - Tips and suggestions + - ``Lightbulb`` + +Changing the set +**************** + +To add an identifier, add it to ``openedx_authz/constants/icons.py`` and to this page, then ask the admin console to map it to an icon. Removing or renaming an identifier breaks schema files that use it, so it is a breaking change to the extension API. diff --git a/docs/references/index.rst b/docs/references/index.rst index 643a85fad..20a0ae922 100644 --- a/docs/references/index.rst +++ b/docs/references/index.rst @@ -5,5 +5,6 @@ References :maxdepth: 1 authorization-schema + icons built-in-constants compiled-schema diff --git a/scripts/generate_paragon_icons.py b/scripts/generate_paragon_icons.py deleted file mode 100644 index 6706d1f0b..000000000 --- a/scripts/generate_paragon_icons.py +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env python -""" -Regenerate the vendored Paragon icon-name allow-list. - -ADR 0017 §4 requires schema validation to reject ``icon`` values that are not -valid ``@openedx/paragon/icons`` names. There is no Python-side source of truth -for that name set, so we vendor it: this script fetches the published Paragon -icon export barrel and writes it as a frozenset in -``src/openedx_authz/engine/schema/paragon_icons.py``. - -Why a vendored list instead of a runtime lookup: ``openedx-authz`` is a Python -backend with no Node/Paragon dependency, so the JS package is not importable at -validation time. Pinning a version keeps validation deterministic and lets the -list follow Paragon's own deprecation process when an icon is renamed or removed -(ADR 0017 §4). - -The Paragon version is pinned to match the ``@openedx/paragon`` major used by -``frontend-app-admin-console`` (``^23``). Bump :data:`PARAGON_VERSION` and rerun -``make paragon_icons`` to refresh. - -Usage:: - - make paragon_icons - python scripts/generate_paragon_icons.py # same thing - python scripts/generate_paragon_icons.py --version 23.21.3 --check - -``--check`` regenerates into memory and fails (exit 1) if the committed file is -stale, without writing. Intended for CI. -""" - -from __future__ import annotations - -import argparse -import re -import sys -import urllib.error -import urllib.request -from pathlib import Path - -# Pinned to the @openedx/paragon major used by frontend-app-admin-console master -# (peerDependency "@openedx/paragon": "^23"). This is the concrete 23.x release -# the vendored list is generated from. -PARAGON_VERSION = "23.21.3" - -# The published package re-exports every generated icon component from this -# built barrel as ``export { default as } from "./";``. -ICONS_BARREL_URL = "https://unpkg.com/@openedx/paragon@{version}/icons/es5/index.js" - -# Captures the exported component name in ``export { default as Name } from ...``. -EXPORT_RE = re.compile(r"export\s*\{\s*default\s+as\s+([A-Za-z_$][\w$]*)\s*\}") - -# Where the vendored module lives, relative to the repo root. -OUTPUT_PATH = Path("src/openedx_authz/engine/schema/paragon_icons.py") - -FILE_TEMPLATE = '''\ -"""Vendored allow-list of valid ``@openedx/paragon/icons`` names. - -GENERATED FILE -- do not edit by hand. Regenerate with:: - - make paragon_icons - -The names are the component exports of ``@openedx/paragon/icons`` at the pinned -version below, used by :mod:`openedx_authz.engine.schema.validation` to reject -schema ``icon`` values that are not real Paragon icons (ADR 0017 §4). - -Source: {source_url} -Paragon version: {version} -Icon count: {count} -""" - -from __future__ import annotations - -PARAGON_VERSION = "{version}" - -PARAGON_ICON_NAMES: frozenset[str] = frozenset( - {{ -{entries} - }} -) -''' - - -class GenerationError(RuntimeError): - """Raised when the icon list cannot be fetched or parsed.""" - - -def fetch_barrel(version: str) -> str: - """Return the text of the Paragon icons export barrel for ``version``.""" - url = ICONS_BARREL_URL.format(version=version) - try: - with urllib.request.urlopen(url, timeout=30) as response: # noqa: S310 - fixed https host - return response.read().decode("utf-8") - except urllib.error.URLError as exc: - raise GenerationError(f"Could not fetch Paragon icons from {url}: {exc}") from exc - - -def parse_icon_names(barrel: str) -> list[str]: - """Extract the sorted, de-duplicated icon names from the export barrel.""" - names = sorted(set(EXPORT_RE.findall(barrel))) - if not names: - raise GenerationError("No icon exports found; the barrel format may have changed.") - return names - - -def render_module(names: list[str], version: str) -> str: - """Render the vendored Python module source for the given icon names.""" - entries = "\n".join(f' "{name}",' for name in names) - return FILE_TEMPLATE.format( - source_url=ICONS_BARREL_URL.format(version=version), - version=version, - count=len(names), - entries=entries, - ) - - -def main(argv: list[str] | None = None) -> int: - """Generate the icon module or check that the committed module is current.""" - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument( - "--version", - default=PARAGON_VERSION, - help=f"Paragon version to generate from (default: {PARAGON_VERSION}).", - ) - parser.add_argument( - "--check", - action="store_true", - help="Fail if the committed file is out of date instead of writing it.", - ) - args = parser.parse_args(argv) - - repo_root = Path(__file__).resolve().parent.parent - output_path = repo_root / OUTPUT_PATH - - try: - names = parse_icon_names(fetch_barrel(args.version)) - except GenerationError as exc: - print(f"error: {exc}", file=sys.stderr) - return 1 - - rendered = render_module(names, args.version) - - if args.check: - current = output_path.read_text(encoding="utf-8") if output_path.exists() else "" - if current != rendered: - print( - f"error: {OUTPUT_PATH} is out of date; run 'make paragon_icons'.", - file=sys.stderr, - ) - return 1 - print(f"{OUTPUT_PATH} is up to date ({len(names)} icons).") - return 0 - - output_path.write_text(rendered, encoding="utf-8") - print(f"Wrote {len(names)} Paragon icon names to {OUTPUT_PATH} (v{args.version}).") - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/src/openedx_authz/api/catalog.py b/src/openedx_authz/api/catalog.py index 4b8d3d24f..aa755a4cd 100644 --- a/src/openedx_authz/api/catalog.py +++ b/src/openedx_authz/api/catalog.py @@ -75,7 +75,7 @@ def get_role_catalog(scope_types: list[str]) -> list[dict]: - ``role``: The role identifier. - ``display_name``: Human-readable name. - ``description``: Role description; empty when unknown. - - ``icon``: Paragon icon name, or ``None``. + - ``icon``: identifier from the Open edX AuthZ icon set, or ``None``. - ``definition_kind``: The :class:`DefinitionKind` value of the role. - ``permissions``: Sorted identifiers of the permissions the role grants in the scope types, without hidden ones. diff --git a/src/openedx_authz/applets/content_libraries/schema/permissions.yaml b/src/openedx_authz/applets/content_libraries/schema/permissions.yaml index 03cf5d2a5..f4c1fdd8c 100644 --- a/src/openedx_authz/applets/content_libraries/schema/permissions.yaml +++ b/src/openedx_authz/applets/content_libraries/schema/permissions.yaml @@ -10,19 +10,19 @@ permission_categories: - id: library display_name: Library description: Permissions related to viewing, managing, and publishing the library structure and metadata. - icon: CollectionsBookmark + icon: collections_bookmark - id: library_content display_name: Content description: Permissions for editing, publishing, and reusing content within the library. - icon: Notes + icon: notes - id: library_team display_name: Team description: Permissions for viewing and managing users who have access to the library. - icon: Group + icon: group - id: library_collection display_name: Collection description: Permissions for creating and managing content collections within the library. - icon: AutoAwesomeMosaic + icon: auto_awesome_mosaic permissions: - namespace: content_libraries @@ -32,7 +32,7 @@ permissions: category_id: library scopes: - lib - icon: RemoveRedEye + icon: remove_red_eye - namespace: content_libraries name: manage_library_tags display_name: Manage tags @@ -40,7 +40,7 @@ permissions: category_id: library scopes: - lib - icon: Settings + icon: settings depends_on: - content_libraries.edit_library_content - namespace: content_libraries @@ -50,7 +50,7 @@ permissions: category_id: library scopes: - lib - icon: Delete + icon: delete depends_on: - content_libraries.edit_library_content - namespace: content_libraries @@ -60,7 +60,7 @@ permissions: category_id: library_content scopes: - lib - icon: EditOutline + icon: edit_outline depends_on: - content_libraries.view_library - namespace: content_libraries @@ -70,7 +70,7 @@ permissions: category_id: library_content scopes: - lib - icon: DownloadDone + icon: download_done depends_on: - content_libraries.edit_library_content - content_libraries.view_library @@ -81,7 +81,7 @@ permissions: category_id: library_content scopes: - lib - icon: SpinnerIcon + icon: spinner depends_on: - content_libraries.view_library - namespace: content_libraries @@ -91,7 +91,7 @@ permissions: category_id: library_team scopes: - lib - icon: RemoveRedEye + icon: remove_red_eye - namespace: content_libraries name: manage_library_team display_name: Manage @@ -99,7 +99,7 @@ permissions: category_id: library_team scopes: - lib - icon: Settings + icon: settings depends_on: - content_libraries.view_library_team - namespace: content_libraries @@ -109,7 +109,7 @@ permissions: category_id: library_collection scopes: - lib - icon: Plus + icon: add depends_on: - content_libraries.edit_library_collection - namespace: content_libraries @@ -119,7 +119,7 @@ permissions: category_id: library_collection scopes: - lib - icon: EditOutline + icon: edit_outline depends_on: - content_libraries.view_library - namespace: content_libraries @@ -129,6 +129,6 @@ permissions: category_id: library_collection scopes: - lib - icon: Delete + icon: delete depends_on: - content_libraries.edit_library_collection diff --git a/src/openedx_authz/applets/course_authoring/schema/permissions.yaml b/src/openedx_authz/applets/course_authoring/schema/permissions.yaml index ccb1133f3..8a4c02045 100644 --- a/src/openedx_authz/applets/course_authoring/schema/permissions.yaml +++ b/src/openedx_authz/applets/course_authoring/schema/permissions.yaml @@ -10,47 +10,47 @@ permission_categories: - id: course_access_content display_name: Course access & content description: Permissions for accessing the course, viewing course and learner information, and managing course content. - icon: BookOpen + icon: book_open - id: course_library_updates display_name: Library updates description: Permissions for reviewing and applying content updates from linked libraries. - icon: LibraryBooks + icon: library_books - id: course_updates_handouts display_name: Course updates & handouts description: Permissions for viewing and managing course announcements and handouts. - icon: Sync + icon: sync - id: course_pages_resources display_name: Pages & resources description: Permissions for viewing and managing course pages and additional learning resources. - icon: Article + icon: article - id: course_files display_name: Files description: Permissions for viewing and managing files and assets uploaded to the course. - icon: Folder + icon: folder - id: course_schedule_details display_name: Schedule & details description: Permissions for viewing and editing the course schedule and details in Studio. - icon: Calendar + icon: calendar - id: course_grading_settings display_name: Grading settings description: Permissions for viewing and editing course grading settings. - icon: Award + icon: award - id: course_team display_name: Course team description: Permissions for viewing course team members and managing course role assignments. - icon: Group + icon: group - id: course_tags_taxonomies display_name: Tags description: Permissions for managing course tags and exporting tag data. - icon: LocalOffer + icon: tag - id: course_advanced_settings_certificates display_name: Advanced settings & certificates description: Permissions for viewing and managing advanced course settings and course certificates in Studio. - icon: CheckCircle + icon: check_circle - id: course_import_export display_name: Course import & export description: Permissions for importing and exporting course content. - icon: Download + icon: download permissions: - namespace: courses @@ -60,7 +60,7 @@ permissions: category_id: course_access_content scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: edit_course_content display_name: Edit course content @@ -68,7 +68,7 @@ permissions: category_id: course_access_content scopes: - course-v1 - icon: EditOutline + icon: edit_outline - namespace: courses name: publish_course_content display_name: Publish course content @@ -76,7 +76,7 @@ permissions: category_id: course_access_content scopes: - course-v1 - icon: DownloadDone + icon: download_done - namespace: courses name: view_library_updates display_name: View library updates @@ -84,7 +84,7 @@ permissions: category_id: course_library_updates scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: manage_library_updates display_name: Manage library updates @@ -92,7 +92,7 @@ permissions: category_id: course_library_updates scopes: - course-v1 - icon: Checklist + icon: checklist - namespace: courses name: view_course_updates display_name: View course updates @@ -100,7 +100,7 @@ permissions: category_id: course_updates_handouts scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: manage_course_updates display_name: Manage course updates @@ -108,7 +108,7 @@ permissions: category_id: course_updates_handouts scopes: - course-v1 - icon: Settings + icon: settings - namespace: courses name: view_pages_and_resources display_name: View pages & resources @@ -116,7 +116,7 @@ permissions: category_id: course_pages_resources scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: manage_pages_and_resources display_name: Manage pages & resources @@ -124,7 +124,7 @@ permissions: category_id: course_pages_resources scopes: - course-v1 - icon: Settings + icon: settings - namespace: courses name: view_files display_name: View files @@ -132,7 +132,7 @@ permissions: category_id: course_files scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: create_files display_name: Create files @@ -140,7 +140,7 @@ permissions: category_id: course_files scopes: - course-v1 - icon: Plus + icon: add - namespace: courses name: edit_files display_name: Edit files @@ -148,7 +148,7 @@ permissions: category_id: course_files scopes: - course-v1 - icon: EditOutline + icon: edit_outline - namespace: courses name: delete_files display_name: Delete files @@ -156,7 +156,7 @@ permissions: category_id: course_files scopes: - course-v1 - icon: Delete + icon: delete - namespace: courses name: view_schedule_and_details display_name: View schedule & details @@ -164,7 +164,7 @@ permissions: category_id: course_schedule_details scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: edit_schedule display_name: Edit schedule @@ -172,7 +172,7 @@ permissions: category_id: course_schedule_details scopes: - course-v1 - icon: EditOutline + icon: edit_outline - namespace: courses name: edit_details display_name: Edit course details @@ -180,7 +180,7 @@ permissions: category_id: course_schedule_details scopes: - course-v1 - icon: EditOutline + icon: edit_outline - namespace: courses name: view_grading_settings display_name: View grading settings @@ -188,7 +188,7 @@ permissions: category_id: course_grading_settings scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: edit_grading_settings display_name: Edit grading settings @@ -196,7 +196,7 @@ permissions: category_id: course_grading_settings scopes: - course-v1 - icon: EditOutline + icon: edit_outline - namespace: courses name: view_course_team display_name: View course team @@ -204,7 +204,7 @@ permissions: category_id: course_team scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: manage_course_team display_name: Manage course team @@ -212,7 +212,7 @@ permissions: category_id: course_team scopes: - course-v1 - icon: Settings + icon: settings - namespace: courses name: view_group_configurations display_name: View group configurations @@ -220,7 +220,7 @@ permissions: category_id: course_cohorts_content_groups scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: manage_group_configurations display_name: Manage group configurations @@ -228,7 +228,7 @@ permissions: category_id: course_cohorts_content_groups scopes: - course-v1 - icon: Settings + icon: settings - namespace: courses name: manage_tags display_name: Manage tags @@ -236,7 +236,7 @@ permissions: category_id: course_tags_taxonomies scopes: - course-v1 - icon: Settings + icon: settings - namespace: courses name: view_advanced_settings display_name: View advanced settings @@ -244,7 +244,7 @@ permissions: category_id: course_advanced_settings_certificates scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: manage_advanced_settings display_name: Manage advanced settings @@ -252,7 +252,7 @@ permissions: category_id: course_advanced_settings_certificates scopes: - course-v1 - icon: Settings + icon: settings - namespace: courses name: view_certificates display_name: View certificates @@ -260,7 +260,7 @@ permissions: category_id: course_advanced_settings_certificates scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: manage_certificates display_name: Manage certificates @@ -268,7 +268,7 @@ permissions: category_id: course_advanced_settings_certificates scopes: - course-v1 - icon: Settings + icon: settings - namespace: courses name: import_course display_name: Import course @@ -276,7 +276,7 @@ permissions: category_id: course_import_export scopes: - course-v1 - icon: Download + icon: arrow_downward - namespace: courses name: export_course display_name: Export course @@ -284,7 +284,7 @@ permissions: category_id: course_import_export scopes: - course-v1 - icon: Upload + icon: arrow_upward - namespace: courses name: export_tags display_name: Export tags @@ -292,7 +292,7 @@ permissions: category_id: course_tags_taxonomies scopes: - course-v1 - icon: Upload + icon: arrow_upward - namespace: courses name: view_checklists display_name: View checklists @@ -300,7 +300,7 @@ permissions: category_id: course_access_content scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: manage_taxonomies display_name: Manage taxonomies @@ -309,4 +309,4 @@ permissions: hidden: true scopes: - course-v1 - icon: LocalOffer + icon: tag diff --git a/src/openedx_authz/applets/course_team_roles/schema/legacy_permissions.yaml b/src/openedx_authz/applets/course_team_roles/schema/legacy_permissions.yaml index 730de3eab..2dee64728 100644 --- a/src/openedx_authz/applets/course_team_roles/schema/legacy_permissions.yaml +++ b/src/openedx_authz/applets/course_team_roles/schema/legacy_permissions.yaml @@ -5,7 +5,7 @@ permission_categories: - id: course_legacy display_name: Legacy compatibility description: Internal compatibility permissions that map legacy course roles to the authorization system. Not shown as individually assignable permissions. - icon: DrawShapes + icon: draw_shapes hidden: true permissions: @@ -16,7 +16,7 @@ permissions: category_id: course_legacy scopes: - course-v1 - icon: DrawShapes + icon: draw_shapes - namespace: courses name: legacy_staff_role_permissions display_name: Legacy staff permissions @@ -24,7 +24,7 @@ permissions: category_id: course_legacy scopes: - course-v1 - icon: DrawShapes + icon: draw_shapes - namespace: courses name: legacy_limited_staff_role_permissions display_name: Legacy limited staff permissions @@ -32,7 +32,7 @@ permissions: category_id: course_legacy scopes: - course-v1 - icon: DrawShapes + icon: draw_shapes - namespace: courses name: legacy_data_researcher_permissions display_name: Legacy data researcher permissions @@ -40,7 +40,7 @@ permissions: category_id: course_legacy scopes: - course-v1 - icon: DrawShapes + icon: draw_shapes - namespace: courses name: legacy_beta_tester_permissions display_name: Legacy beta tester permissions @@ -48,4 +48,4 @@ permissions: category_id: course_legacy scopes: - course-v1 - icon: DrawShapes + icon: draw_shapes diff --git a/src/openedx_authz/applets/enrollments/schema/permissions.yaml b/src/openedx_authz/applets/enrollments/schema/permissions.yaml index 20ac8f63f..ebd9d6778 100644 --- a/src/openedx_authz/applets/enrollments/schema/permissions.yaml +++ b/src/openedx_authz/applets/enrollments/schema/permissions.yaml @@ -1,13 +1,13 @@ schema_version: "1.0" priority: 100 -# Icons are Paragon icon names (@openedx/paragon/icons). +# Icons are identifiers from the Open edX AuthZ icon set (docs/references/icons.rst). permission_categories: - id: course_enrollments display_name: Enrollments description: Permissions for viewing and managing learner enrollments in the Instructor Dashboard. - icon: People + icon: people permissions: - namespace: courses @@ -17,7 +17,7 @@ permissions: category_id: course_enrollments scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: enroll_learners display_name: Enroll learners @@ -25,7 +25,7 @@ permissions: category_id: course_enrollments scopes: - course-v1 - icon: PersonAdd + icon: person_add - namespace: courses name: unenroll_learners display_name: Unenroll learners @@ -33,4 +33,4 @@ permissions: category_id: course_enrollments scopes: - course-v1 - icon: PersonRemove + icon: person_remove diff --git a/src/openedx_authz/applets/learner_administration/schema/permissions.yaml b/src/openedx_authz/applets/learner_administration/schema/permissions.yaml index ec38c5ce5..b4e24e8a5 100644 --- a/src/openedx_authz/applets/learner_administration/schema/permissions.yaml +++ b/src/openedx_authz/applets/learner_administration/schema/permissions.yaml @@ -7,11 +7,11 @@ permission_categories: - id: course_learner_extensions display_name: Learner extensions description: Permissions for viewing and managing individual learner extensions in the Instructor Dashboard. - icon: Event + icon: event - id: course_cohorts_content_groups display_name: Cohorts & content groups description: Permissions for organizing learners into cohorts in the Instructor Dashboard and configuring content groups in Studio. - icon: Groups + icon: groups permissions: - namespace: courses @@ -21,7 +21,7 @@ permissions: category_id: course_access_content scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: view_learner_course_status display_name: View learner course status @@ -29,7 +29,7 @@ permissions: category_id: course_access_content scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: view_learner_extensions display_name: View learner extensions @@ -37,7 +37,7 @@ permissions: category_id: course_learner_extensions scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: manage_learner_extensions display_name: Manage learner extensions @@ -45,7 +45,7 @@ permissions: category_id: course_learner_extensions scopes: - course-v1 - icon: Settings + icon: settings depends_on: - courses.view_learner_course_status - namespace: courses @@ -55,7 +55,7 @@ permissions: category_id: course_cohorts_content_groups scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye - namespace: courses name: manage_cohorts display_name: Manage cohorts @@ -63,4 +63,4 @@ permissions: category_id: course_cohorts_content_groups scopes: - course-v1 - icon: Settings + icon: settings diff --git a/src/openedx_authz/applets/learner_grading/schema/permissions.yaml b/src/openedx_authz/applets/learner_grading/schema/permissions.yaml index 0efece71a..8b3656a97 100644 --- a/src/openedx_authz/applets/learner_grading/schema/permissions.yaml +++ b/src/openedx_authz/applets/learner_grading/schema/permissions.yaml @@ -7,7 +7,7 @@ permission_categories: - id: course_learner_grading display_name: Learner grading description: Permissions for viewing learner grades and using grading tools in the Instructor Dashboard. - icon: Grading + icon: grading permissions: - namespace: courses @@ -17,7 +17,7 @@ permissions: category_id: course_learner_grading scopes: - course-v1 - icon: RemoveRedEye + icon: remove_red_eye depends_on: - courses.view_course_info - namespace: courses @@ -27,7 +27,7 @@ permissions: category_id: course_learner_grading scopes: - course-v1 - icon: Settings + icon: settings depends_on: - courses.view_learner_course_status - namespace: courses @@ -37,6 +37,6 @@ permissions: category_id: course_learner_grading scopes: - course-v1 - icon: Settings + icon: settings depends_on: - courses.manage_learner_grading diff --git a/src/openedx_authz/constants/icons.py b/src/openedx_authz/constants/icons.py new file mode 100644 index 000000000..f048b80be --- /dev/null +++ b/src/openedx_authz/constants/icons.py @@ -0,0 +1,180 @@ +"""The Open edX AuthZ icon set (ADR 0039). + +These identifiers are the allowed values of every ``icon`` field in the authorization +schema, and are part of its extension API. They are owned by this repository and do not +depend on any icon library: each client maps an identifier to the icon it renders. + +When you add an identifier here, also document it in ``docs/references/icons.rst``. +""" + +AUTHZ_ICONS: frozenset[str] = frozenset( + { + # Roles and permissions + "institution", + "person", + "place", + "add", + "school", + "language", + "library_books", + "collections_bookmark", + "remove_red_eye", + "book_open", + "edit_outline", + "edit", + "download_done", + "checklist", + "spinner", + "settings", + "description", + "folder", + "delete", + "calendar", + "event", + "award", + "people", + "group", + "tag", + "verified", + "download", + "arrow_downward", + "arrow_upward", + "draw_shapes", + "program", + "text_snippet", + "auto_awesome_mosaic", + # Navigation + "arrow_back", + "arrow_forward", + "chevron_left", + "chevron_right", + "expand_more", + "expand_less", + "arrow_drop_down", + "home", + "menu", + "more_vert", + "more_horiz", + "open_in_new", + "close", + "drag_indicator", + "logout", + "arrow_drop_up", + "unfold_more", + "first_page", + "last_page", + "fullscreen", + "fullscreen_exit", + "login", + # Actions + "add_circle_outline", + "remove", + "delete_outline", + "content_copy", + "save", + "search", + "check", + "refresh", + "link", + "upload", + "filter_list", + "sort", + "publish", + "visibility", + "visibility_off", + "add_circle", + "remove_circle_outline", + "undo", + "redo", + "share", + "tune", + "print", + "send", + "archive", + "block", + # Status & feedback + "info", + "info_outline", + "warning", + "error", + "error_outline", + "check_circle", + "cancel", + "help_outline", + "access_time", + "check_circle_outline", + "help", + "pending", + "hourglass_empty", + "sync", + "schedule", + "alarm", + # Users & access + "account_circle", + "person_add", + "person_remove", + "groups", + "manage_accounts", + "admin_panel_settings", + "lock", + "lock_open", + "email", + "supervisor_account", + "security", + "verified_user", + "key", + # Learning & content + "assignment", + "quiz", + "grading", + "assessment", + "article", + "videocam", + "play_circle", + "forum", + "extension", + "workspace_premium", + "lms_book", + "lms_videocam", + "lms_edit_square", + "lms_completion_solid", + "auto_stories", + "book", + "play_arrow", + "pause", + "question_answer", + "comment", + "notes", + "code", + "translate", + "accessibility", + # Files & data + "insert_drive_file", + "upload_file", + "attach_file", + "image", + "bar_chart", + "folder_open", + "attachment", + "picture_as_pdf", + "trending_up", + "insights", + # Views & layout + "dashboard", + "grid_view", + "view_list", + "list", + # Communication + "notifications", + "notifications_off", + "announcement", + # General + "star", + "star_border", + "bookmark", + "bookmark_border", + "public", + "bolt", + "lightbulb", + } +) diff --git a/src/openedx_authz/engine/schema/authz-schema-v1.1.json b/src/openedx_authz/engine/schema/authz-schema-v1.1.json index 001be7265..b45c1d892 100644 --- a/src/openedx_authz/engine/schema/authz-schema-v1.1.json +++ b/src/openedx_authz/engine/schema/authz-schema-v1.1.json @@ -34,7 +34,7 @@ "id": "course_content", "display_name": "Course content", "description": "Permissions for viewing and editing course content.", - "icon": "Article" + "icon": "article" } ] ] @@ -56,7 +56,7 @@ "description": "View course configuration and content.", "category_id": "course_content", "scopes": ["course-v1"], - "icon": "Visibility" + "icon": "visibility" } ] ] @@ -137,10 +137,10 @@ "examples": ["View course configuration and content."] }, "icon": { - "description": "A case-sensitive icon name exported by @openedx/paragon/icons.", + "description": "An identifier from the Open edX AuthZ icon set.", "type": "string", - "pattern": "^[A-Z][A-Za-z0-9]*$", - "examples": ["Visibility"] + "pattern": "^[a-z][a-z0-9]*(_[a-z0-9]+)*$", + "examples": ["visibility"] }, "permission_list": { "description": "A non-empty list of unique, complete permission identifiers.", @@ -193,7 +193,7 @@ }, "icon": { "title": "Category icon", - "examples": ["Article"], + "examples": ["article"], "$ref": "#/$defs/icon" }, "hidden": { @@ -248,7 +248,7 @@ }, "icon": { "title": "Permission icon", - "examples": ["Visibility"], + "examples": ["visibility"], "$ref": "#/$defs/icon" }, "hidden": { @@ -303,7 +303,7 @@ }, "icon": { "title": "Role icon", - "examples": ["Visibility"], + "examples": ["visibility"], "$ref": "#/$defs/icon" }, "hidden": { @@ -354,8 +354,8 @@ }, "icon": { "title": "Extension icon", - "description": "A replacement Paragon icon name.", - "examples": ["Edit"], + "description": "A replacement icon identifier.", + "examples": ["edit"], "$ref": "#/$defs/icon" }, "hidden": { @@ -384,7 +384,7 @@ "id": "course_content", "display_name": "Course content", "description": "Permissions for viewing and editing course content.", - "icon": "Article" + "icon": "article" } ], "permissions": [ @@ -395,7 +395,7 @@ "description": "View course configuration and content.", "category_id": "course_content", "scopes": ["course-v1"], - "icon": "Visibility" + "icon": "visibility" }, { "namespace": "courses", @@ -404,7 +404,7 @@ "description": "Export course configuration and content.", "category_id": "course_content", "scopes": ["course-v1"], - "icon": "Download", + "icon": "download", "depends_on": ["courses.view_course"] } ], diff --git a/src/openedx_authz/engine/schema/authz-schema-v1.json b/src/openedx_authz/engine/schema/authz-schema-v1.json index 7a81522b6..b65154443 100644 --- a/src/openedx_authz/engine/schema/authz-schema-v1.json +++ b/src/openedx_authz/engine/schema/authz-schema-v1.json @@ -34,7 +34,7 @@ "id": "course_content", "display_name": "Course content", "description": "Permissions for viewing and editing course content.", - "icon": "Article" + "icon": "article" } ] ] @@ -56,7 +56,7 @@ "description": "View course configuration and content.", "category_id": "course_content", "scopes": ["course-v1"], - "icon": "Visibility" + "icon": "visibility" } ] ] @@ -137,10 +137,10 @@ "examples": ["View course configuration and content."] }, "icon": { - "description": "A case-sensitive icon name exported by @openedx/paragon/icons.", + "description": "An identifier from the Open edX AuthZ icon set.", "type": "string", - "pattern": "^[A-Z][A-Za-z0-9]*$", - "examples": ["Visibility"] + "pattern": "^[a-z][a-z0-9]*(_[a-z0-9]+)*$", + "examples": ["visibility"] }, "permission_list": { "description": "A non-empty list of unique, complete permission identifiers.", @@ -193,7 +193,7 @@ }, "icon": { "title": "Category icon", - "examples": ["Article"], + "examples": ["article"], "$ref": "#/$defs/icon" }, "hidden": { @@ -248,7 +248,7 @@ }, "icon": { "title": "Permission icon", - "examples": ["Visibility"], + "examples": ["visibility"], "$ref": "#/$defs/icon" }, "hidden": { @@ -297,7 +297,7 @@ }, "icon": { "title": "Role icon", - "examples": ["Visibility"], + "examples": ["visibility"], "$ref": "#/$defs/icon" }, "hidden": { @@ -348,8 +348,8 @@ }, "icon": { "title": "Extension icon", - "description": "A replacement Paragon icon name.", - "examples": ["Edit"], + "description": "A replacement icon identifier.", + "examples": ["edit"], "$ref": "#/$defs/icon" }, "hidden": { @@ -378,7 +378,7 @@ "id": "course_content", "display_name": "Course content", "description": "Permissions for viewing and editing course content.", - "icon": "Article" + "icon": "article" } ], "permissions": [ @@ -389,7 +389,7 @@ "description": "View course configuration and content.", "category_id": "course_content", "scopes": ["course-v1"], - "icon": "Visibility" + "icon": "visibility" }, { "namespace": "courses", @@ -398,7 +398,7 @@ "description": "Export course configuration and content.", "category_id": "course_content", "scopes": ["course-v1"], - "icon": "Download" + "icon": "download" } ], "roles": [ diff --git a/src/openedx_authz/engine/schema/paragon_icons.py b/src/openedx_authz/engine/schema/paragon_icons.py deleted file mode 100644 index 5953fd4b5..000000000 --- a/src/openedx_authz/engine/schema/paragon_icons.py +++ /dev/null @@ -1,2340 +0,0 @@ -"""Vendored allow-list of valid ``@openedx/paragon/icons`` names. - -GENERATED FILE -- do not edit by hand. Regenerate with:: - - make paragon_icons - -The names are the component exports of ``@openedx/paragon/icons`` at the pinned -version below, used by :mod:`openedx_authz.engine.schema.validation` to reject -schema ``icon`` values that are not real Paragon icons (ADR 0017 §4). - -Source: https://unpkg.com/@openedx/paragon@23.21.3/icons/es5/index.js -Paragon version: 23.21.3 -Icon count: 2317 -""" - -from __future__ import annotations - -PARAGON_VERSION = "23.21.3" - -PARAGON_ICON_NAMES: frozenset[str] = frozenset( - { - "Abc", - "AcUnit", - "AccessAlarm", - "AccessAlarms", - "AccessTime", - "AccessTimeFilled", - "Accessibility", - "AccessibilityNew", - "Accessible", - "AccessibleForward", - "AccountBalance", - "AccountBalanceWallet", - "AccountBox", - "AccountCircle", - "AccountTree", - "AdUnits", - "Adb", - "Add", - "AddAPhoto", - "AddAlarm", - "AddAlert", - "AddBox", - "AddBusiness", - "AddCard", - "AddCircle", - "AddCircleOutline", - "AddComment", - "AddHome", - "AddHomeWork", - "AddIcCall", - "AddLink", - "AddLocation", - "AddLocationAlt", - "AddModerator", - "AddPhotoAlternate", - "AddReaction", - "AddRoad", - "AddShoppingCart", - "AddTask", - "AddToDrive", - "AddToHomeScreen", - "AddToPhotos", - "AddToQueue", - "Addchart", - "AdfScanner", - "Adjust", - "AdminPanelSettings", - "Adobe", - "AdsClick", - "Agriculture", - "Air", - "AirlineSeatFlat", - "AirlineSeatFlatAngled", - "AirlineSeatIndividualSuite", - "AirlineSeatLegroomExtra", - "AirlineSeatLegroomNormal", - "AirlineSeatLegroomReduced", - "AirlineSeatReclineExtra", - "AirlineSeatReclineNormal", - "AirlineStops", - "Airlines", - "AirplaneTicket", - "AirplanemodeActive", - "AirplanemodeInactive", - "Airplay", - "AirportShuttle", - "Alarm", - "AlarmAdd", - "AlarmOff", - "AlarmOn", - "Album", - "AlignHorizontalCenter", - "AlignHorizontalLeft", - "AlignHorizontalRight", - "AlignVerticalBottom", - "AlignVerticalCenter", - "AlignVerticalTop", - "AllInbox", - "AllInclusive", - "AllOut", - "AltRoute", - "AlternateEmail", - "AmpStories", - "Analytics", - "Anchor", - "Android", - "Animation", - "Announcement", - "Aod", - "Apartment", - "Api", - "AppBlocking", - "AppRegistration", - "AppSettingsAlt", - "AppShortcut", - "Apple", - "Approval", - "Apps", - "AppsOutage", - "Architecture", - "Archive", - "AreaChart", - "ArrowBack", - "ArrowBackIos", - "ArrowBackIosNew", - "ArrowCircleDown", - "ArrowCircleLeft", - "ArrowCircleRight", - "ArrowCircleUp", - "ArrowDownward", - "ArrowDropDown", - "ArrowDropDownCircle", - "ArrowDropUp", - "ArrowDropUpDown", - "ArrowForward", - "ArrowForwardIos", - "ArrowLeft", - "ArrowOutward", - "ArrowRight", - "ArrowRightAlt", - "ArrowUpward", - "ArtTrack", - "Article", - "AspectRatio", - "Assessment", - "Assignment", - "AssignmentInd", - "AssignmentLate", - "AssignmentReturn", - "AssignmentReturned", - "AssignmentTurnedIn", - "AssistWalker", - "Assistant", - "AssistantDirection", - "AssistantPhoto", - "AssuredWorkload", - "Atm", - "AttachEmail", - "AttachFile", - "AttachMoney", - "Attachment", - "Attractions", - "Attribution", - "AudioFile", - "Audiotrack", - "AutoAwesome", - "AutoAwesomeMosaic", - "AutoAwesomeMotion", - "AutoDelete", - "AutoFixHigh", - "AutoFixNormal", - "AutoFixOff", - "AutoGraph", - "AutoMode", - "AutoStories", - "AutofpsSelect", - "Autorenew", - "AvTimer", - "Award", - "BabyChangingStation", - "BackHand", - "Backpack", - "Backspace", - "Backup", - "BackupTable", - "BadgeIcon", - "BakeryDining", - "Balance", - "Balcony", - "Ballot", - "BarChart", - "Barcode", - "BatchPrediction", - "Bathroom", - "Bathtub", - "Battery0Bar", - "Battery1Bar", - "Battery20", - "Battery2Bar", - "Battery30", - "Battery3Bar", - "Battery4Bar", - "Battery50", - "Battery5Bar", - "Battery60", - "Battery6Bar", - "Battery80", - "Battery90", - "BatteryAlert", - "BatteryCharging20", - "BatteryCharging30", - "BatteryCharging50", - "BatteryCharging60", - "BatteryCharging80", - "BatteryCharging90", - "BatteryChargingFull", - "BatteryFull", - "BatterySaver", - "BatteryStd", - "BatteryUnknown", - "Bbb", - "BeachAccess", - "Bed", - "BedroomBaby", - "BedroomChild", - "BedroomParent", - "Bedtime", - "BedtimeOff", - "Beenhere", - "Bento", - "BikeScooter", - "Biotech", - "Blender", - "Blind", - "Blinds", - "BlindsClosed", - "Block", - "Blocked", - "Bloodtype", - "Bluetooth", - "BluetoothAudio", - "BluetoothConnected", - "BluetoothDisabled", - "BluetoothDrive", - "BluetoothSearching", - "BlurCircular", - "BlurLinear", - "BlurOff", - "BlurOn", - "Bolt", - "Book", - "BookOnline", - "BookOpen", - "Bookmark", - "BookmarkAdd", - "BookmarkAdded", - "BookmarkBorder", - "BookmarkRemove", - "Bookmarks", - "BorderAll", - "BorderBottom", - "BorderClear", - "BorderColor", - "BorderHorizontal", - "BorderInner", - "BorderLeft", - "BorderOuter", - "BorderRight", - "BorderStyle", - "BorderTop", - "BorderVertical", - "Boy", - "BrandingWatermark", - "BreakfastDining", - "Brightness1", - "Brightness2", - "Brightness3", - "Brightness4", - "Brightness5", - "Brightness6", - "Brightness7", - "BrightnessAuto", - "BrightnessHigh", - "BrightnessLow", - "BrightnessMedium", - "BroadcastOnHome", - "BroadcastOnPersonal", - "BrokenImage", - "BrowseGallery", - "BrowserNotSupported", - "BrowserUpdated", - "BrunchDining", - "Brush", - "BsAlexa", - "BsAlipay", - "BsAmd", - "BsAndroid", - "BsAndroid2", - "BsApple", - "BsBehance", - "BsBluetooth", - "BsBrowserChrome", - "BsBrowserEdge", - "BsBrowserFirefox", - "BsBrowserSafari", - "BsDiscord", - "BsDribbble", - "BsDropbox", - "BsFacebook", - "BsGit", - "BsGithub", - "BsGoogle", - "BsGooglePlay", - "BsInstagram", - "BsLine", - "BsLinkedin", - "BsMastodon", - "BsMedium", - "BsMessenger", - "BsMeta", - "BsMicrosoft", - "BsMicrosoftTeams", - "BsNintendoSwitch", - "BsNvidia", - "BsPaypal", - "BsPinterest", - "BsPlaystation", - "BsQuora", - "BsReddit", - "BsSignal", - "BsSinaWeibo", - "BsSkype", - "BsSlack", - "BsSnapchat", - "BsSpotify", - "BsStackOverflow", - "BsSteam", - "BsStrava", - "BsStripe", - "BsTelegram", - "BsTencentQq", - "BsTiktok", - "BsTrello", - "BsTwitch", - "BsTwitter", - "BsTwitterX", - "BsUbuntu", - "BsUnity", - "BsVimeo", - "BsWechat", - "BsWhatsapp", - "BsWikipedia", - "BsWindows", - "BsWordpress", - "BsXbox", - "BsYelp", - "BsYoutube", - "BubbleChart", - "BugReport", - "Build", - "BuildCircle", - "Bungalow", - "BurstMode", - "BusAlert", - "Business", - "BusinessCenter", - "Cabin", - "Cable", - "Cached", - "Cake", - "Calculate", - "Calendar", - "CalendarMonth", - "CalendarToday", - "CalendarViewDay", - "CalendarViewMonth", - "CalendarViewWeek", - "Call", - "CallEnd", - "CallMade", - "CallMerge", - "CallMissed", - "CallMissedOutgoing", - "CallReceived", - "CallSplit", - "CallToAction", - "Camera", - "CameraAlt", - "CameraEnhance", - "CameraFront", - "CameraIndoor", - "CameraOutdoor", - "CameraRear", - "CameraRoll", - "Cameraswitch", - "Campaign", - "Cancel", - "CancelPresentation", - "CancelScheduleSend", - "CandlestickChart", - "CarCrash", - "CarRental", - "CarRepair", - "CardGiftcard", - "CardMembership", - "CardTravel", - "Carpenter", - "Cases", - "Casino", - "Cast", - "CastConnected", - "CastForEducation", - "Castle", - "CatchingPokemon", - "Category", - "Cc", - "Celebration", - "CellTower", - "CellWifi", - "CenterFocusStrong", - "CenterFocusWeak", - "Chair", - "ChairAlt", - "Chalet", - "ChangeCircle", - "ChangeHistory", - "ChargingStation", - "Chat", - "ChatBubble", - "ChatBubbleOutline", - "Check", - "CheckBoxIcon", - "CheckBoxOutlineBlank", - "CheckCircle", - "CheckCircleLightOutline", - "CheckCircleOutline", - "Checklist", - "ChecklistRtl", - "Checkroom", - "ChevronLeft", - "ChevronRight", - "ChildCare", - "ChildFriendly", - "ChromeReaderMode", - "Church", - "Circle", - "CircleNotifications", - "Class", - "CleanHands", - "CleaningServices", - "Clear", - "ClearAll", - "Close", - "CloseFullscreen", - "CloseSmall", - "ClosedCaption", - "ClosedCaptionDisabled", - "ClosedCaptionOff", - "Cloud", - "CloudCircle", - "CloudDone", - "CloudDownload", - "CloudOff", - "CloudQueue", - "CloudSync", - "CloudUpload", - "Co2", - "CoPresent", - "Code", - "CodeOff", - "Coffee", - "CoffeeMaker", - "Collections", - "CollectionsBookmark", - "ColorLens", - "Colorize", - "Comment", - "CommentBank", - "CommentsDisabled", - "Commit", - "Commute", - "Compare", - "CompareArrows", - "Compass", - "CompassCalibration", - "Compost", - "Compress", - "Computer", - "ConfirmationNumber", - "ConnectWithoutContact", - "ConnectedTv", - "ConnectingAirports", - "Construction", - "ContactEmergency", - "ContactMail", - "ContactPage", - "ContactPhone", - "ContactSupport", - "Contactless", - "Contacts", - "ContentCopy", - "ContentCut", - "ContentPaste", - "ContentPasteGo", - "ContentPasteOff", - "ContentPasteSearch", - "Contrast", - "ControlCamera", - "ControlPoint", - "ControlPointDuplicate", - "Cookie", - "CopyAll", - "Copyright", - "Coronavirus", - "CorporateFare", - "Cottage", - "Countertops", - "Create", - "CreateNewFolder", - "CreditCard", - "CreditCardOff", - "CreditScore", - "Crib", - "CrisisAlert", - "Crop", - "Crop169", - "Crop32", - "Crop54", - "Crop75", - "CropDin", - "CropFree", - "CropLandscape", - "CropOriginal", - "CropPortrait", - "CropRotate", - "CropSquare", - "CrueltyFree", - "Css", - "CurrencyBitcoin", - "CurrencyExchange", - "CurrencyFranc", - "CurrencyLira", - "CurrencyPound", - "CurrencyRuble", - "CurrencyRupee", - "CurrencyYen", - "CurrencyYuan", - "Curtains", - "CurtainsClosed", - "Cyclone", - "Dangerous", - "DarkMode", - "Dashboard", - "DashboardCustomize", - "DataArray", - "DataExploration", - "DataObject", - "DataSaverOff", - "DataSaverOn", - "DataThresholding", - "DataUsage", - "Dataset", - "DatasetLinked", - "DateRange", - "Deblur", - "Deck", - "Dehaze", - "Delete", - "DeleteForever", - "DeleteOutline", - "DeleteSweep", - "DeliveryDining", - "DensityLarge", - "DensityMedium", - "DensitySmall", - "DepartureBoard", - "Description", - "Deselect", - "DesignServices", - "Desk", - "DesktopAccessDisabled", - "DesktopMac", - "DesktopWindows", - "Details", - "DeveloperBoard", - "DeveloperBoardOff", - "DeveloperMode", - "DeviceHub", - "DeviceThermostat", - "DeviceUnknown", - "Devices", - "DevicesFold", - "DevicesOther", - "DialerSip", - "Dialpad", - "Diamond", - "Difference", - "Dining", - "DinnerDining", - "Directions", - "DirectionsBike", - "DirectionsBoat", - "DirectionsBoatFilled", - "DirectionsBus", - "DirectionsBusFilled", - "DirectionsCar", - "DirectionsCarFilled", - "DirectionsOff", - "DirectionsRailway", - "DirectionsRailwayFilled", - "DirectionsRun", - "DirectionsSubway", - "DirectionsSubwayFilled", - "DirectionsTransit", - "DirectionsTransitFilled", - "DirectionsWalk", - "DirtyLens", - "DisabledByDefault", - "DisabledVisible", - "DiscFull", - "Discord", - "Discount", - "DisplaySettings", - "Diversity1", - "Diversity2", - "Diversity3", - "Divide", - "DjangoShort", - "Dns", - "DoDisturb", - "DoDisturbAlt", - "DoDisturbOff", - "DoDisturbOn", - "DoNotDisturb", - "DoNotDisturbAlt", - "DoNotDisturbOff", - "DoNotDisturbOn", - "DoNotDisturbOnTotalSilence", - "DoNotStep", - "DoNotTouch", - "Dock", - "DocumentScanner", - "Domain", - "DomainAdd", - "DomainDisabled", - "DomainVerification", - "Done", - "DoneAll", - "DoneOutline", - "DonutLarge", - "DonutSmall", - "DoorBack", - "DoorFront", - "DoorSliding", - "Doorbell", - "DoubleArrow", - "DownhillSkiing", - "Download", - "DownloadDone", - "DownloadForOffline", - "Downloading", - "Drafts", - "DragHandle", - "DragIndicator", - "Draw", - "DrawShapes", - "DriveEta", - "DriveFileMove", - "DriveFileMoveRtl", - "DriveFileRenameOutline", - "DriveFolderUpload", - "Dry", - "DryCleaning", - "Duo", - "Dvr", - "DynamicFeed", - "DynamicForm", - "EMobiledata", - "Earbuds", - "EarbudsBattery", - "East", - "Eco", - "EdgesensorHigh", - "EdgesensorLow", - "Edit", - "EditAttributes", - "EditCalendar", - "EditCircle", - "EditLocation", - "EditLocationAlt", - "EditNote", - "EditNotifications", - "EditOff", - "EditOutline", - "EditRoad", - "Egg", - "EggAlt", - "Eject", - "Elderly", - "ElderlyWoman", - "ElectricBike", - "ElectricBolt", - "ElectricCar", - "ElectricMeter", - "ElectricMoped", - "ElectricRickshaw", - "ElectricScooter", - "ElectricalServices", - "Elevator", - "Email", - "Emergency", - "EmergencyRecording", - "EmergencyShare", - "EmojiEmotions", - "EmojiEvents", - "EmojiFlags", - "EmojiFoodBeverage", - "EmojiNature", - "EmojiObjects", - "EmojiPeople", - "EmojiSymbols", - "EmojiTransportation", - "EnergySavingsLeaf", - "Engineering", - "EnhancedEncryption", - "Equalizer", - "Equals", - "Error", - "ErrorOutline", - "Escalator", - "EscalatorWarning", - "Euro", - "EuroSymbol", - "EvStation", - "Event", - "EventAvailable", - "EventBusy", - "EventNote", - "EventRepeat", - "EventSeat", - "ExitToApp", - "Expand", - "ExpandCircleDown", - "ExpandLess", - "ExpandMore", - "Explicit", - "Explore", - "ExploreOff", - "Exposure", - "ExposureNeg1", - "ExposureNeg2", - "ExposurePlus1", - "ExposurePlus2", - "ExposureZero", - "Extension", - "ExtensionOff", - "Face", - "Face2", - "Face3", - "Face4", - "Face5", - "Face6", - "FaceRetouchingNatural", - "FaceRetouchingOff", - "Facebook", - "FacebookCircle", - "FactCheck", - "Factory", - "FamilyRestroom", - "FastForward", - "FastRewind", - "Fastfood", - "Favorite", - "FavoriteBorder", - "Fax", - "FeaturedPlayList", - "FeaturedVideo", - "Feed", - "Feedback", - "FeedbackOutline", - "Female", - "Fence", - "Festival", - "FiberDvr", - "FiberManualRecord", - "FiberNew", - "FiberPin", - "FiberSmartRecord", - "FileCopy", - "FileDownload", - "FileDownloadDone", - "FileDownloadOff", - "FileOpen", - "FilePresent", - "FileUpload", - "Filter", - "Filter1", - "Filter2", - "Filter3", - "Filter4", - "Filter5", - "Filter6", - "Filter7", - "Filter8", - "Filter9", - "Filter9Plus", - "FilterAlt", - "FilterAltOff", - "FilterBAndW", - "FilterCenterFocus", - "FilterDrama", - "FilterFrames", - "FilterHdr", - "FilterList", - "FilterListOff", - "FilterNone", - "FilterTiltShift", - "FilterVintage", - "FindInPage", - "FindReplace", - "Fingerprint", - "FireExtinguisher", - "FireHydrantAlt", - "FireTruck", - "Fireplace", - "FirstPage", - "FitScreen", - "Fitbit", - "FitnessCenter", - "Flag", - "FlagCircle", - "Flaky", - "Flare", - "FlashAuto", - "FlashOff", - "FlashOn", - "FlashlightOff", - "FlashlightOn", - "Flatware", - "Flight", - "FlightClass", - "FlightLand", - "FlightTakeoff", - "Flip", - "FlipCameraAndroid", - "FlipCameraIos", - "FlipToBack", - "FlipToFront", - "Flood", - "Flourescent", - "Fluorescent", - "FlutterDash", - "FmdBad", - "FmdGood", - "Folder", - "FolderCopy", - "FolderDelete", - "FolderOff", - "FolderOpen", - "FolderShared", - "FolderSpecial", - "FolderZip", - "FollowTheSigns", - "FontDownload", - "FontDownloadOff", - "FoodBank", - "Forest", - "ForkLeft", - "ForkRight", - "FormatAlignCenter", - "FormatAlignJustify", - "FormatAlignLeft", - "FormatAlignRight", - "FormatBold", - "FormatClear", - "FormatColorFill", - "FormatColorReset", - "FormatColorText", - "FormatIndentDecrease", - "FormatIndentIncrease", - "FormatItalic", - "FormatLineSpacing", - "FormatListBulleted", - "FormatListNumbered", - "FormatListNumberedRtl", - "FormatOverline", - "FormatPaint", - "FormatQuote", - "FormatShapes", - "FormatSize", - "FormatStrikethrough", - "FormatTextdirectionLToR", - "FormatTextdirectionRToL", - "FormatUnderlined", - "Fort", - "Forum", - "Forward", - "Forward10", - "Forward30", - "Forward5", - "ForwardToInbox", - "Foundation", - "FreeBreakfast", - "FreeCancellation", - "FrontHand", - "Fullscreen", - "FullscreenExit", - "Functions", - "GMobiledata", - "GTranslate", - "Gamepad", - "Games", - "Garage", - "GasMeter", - "Gavel", - "GeneratingTokens", - "Gesture", - "GetApp", - "Gif", - "GifBox", - "Girl", - "Gite", - "GolfCourse", - "GoogleMeet", - "GppBad", - "GppGood", - "GppMaybe", - "GpsFixed", - "GpsNotFixed", - "GpsOff", - "Grade", - "Gradient", - "Grading", - "Grain", - "GraphicEq", - "Grass", - "GreaterThan", - "GreaterThanEqual", - "Grid3X3", - "Grid4X4", - "GridGoldenratio", - "GridOff", - "GridOn", - "GridView", - "Group", - "GroupAdd", - "GroupOff", - "GroupRemove", - "GroupWork", - "Groups", - "Groups2", - "Groups3", - "HMobiledata", - "HPlusMobiledata", - "Hail", - "Handshake", - "Handyman", - "Hardware", - "Hd", - "HdrAuto", - "HdrAutoSelect", - "HdrEnhancedSelect", - "HdrOff", - "HdrOffSelect", - "HdrOn", - "HdrOnSelect", - "HdrPlus", - "HdrStrong", - "HdrWeak", - "Headphones", - "HeadphonesBattery", - "Headset", - "HeadsetMic", - "HeadsetOff", - "Healing", - "HealthAndSafety", - "Hearing", - "HearingDisabled", - "HeartBroken", - "HeatPump", - "Height", - "Help", - "HelpCenter", - "HelpOutline", - "Hevc", - "Hexagon", - "HideImage", - "HideSource", - "HighQuality", - "Highlight", - "HighlightAlt", - "HighlightOff", - "Hiking", - "History", - "HistoryEdu", - "HistoryToggleOff", - "Hive", - "Hls", - "HlsOff", - "HolidayVillage", - "Home", - "HomeMax", - "HomeMini", - "HomeRepairService", - "HomeWork", - "HorizontalDistribute", - "HorizontalRule", - "HorizontalSplit", - "HotTub", - "Hotel", - "HotelClass", - "HourglassBottom", - "HourglassDisabled", - "HourglassEmpty", - "HourglassFull", - "HourglassTop", - "House", - "HouseSiding", - "Houseboat", - "HowToReg", - "HowToVote", - "Html", - "Http", - "Https", - "Hub", - "Hvac", - "IceSkating", - "Icecream", - "ImageAspectRatio", - "ImageIcon", - "ImageNotSupported", - "ImageSearch", - "ImagesearchRoller", - "ImportContacts", - "ImportExport", - "ImportantDevices", - "Inbox", - "IncompleteCircle", - "IndeterminateCheckBox", - "Info", - "InfoOutline", - "InputIcon", - "InsertChart", - "InsertChartOutlined", - "InsertComment", - "InsertDriveFile", - "InsertEmoticon", - "InsertInvitation", - "InsertLink", - "InsertPageBreak", - "InsertPhoto", - "Insights", - "InstallDesktop", - "InstallMobile", - "Institution", - "IntegrationInstructions", - "Interests", - "InterpreterMode", - "Inventory", - "Inventory2", - "InvertColors", - "InvertColorsOff", - "IosShare", - "Iron", - "Iso", - "Issue", - "Javascript", - "JoinFull", - "JoinInner", - "JoinLeft", - "JoinRight", - "Kayaking", - "KebabDining", - "Key", - "KeyOff", - "Keyboard", - "KeyboardAlt", - "KeyboardArrowDown", - "KeyboardArrowLeft", - "KeyboardArrowRight", - "KeyboardArrowUp", - "KeyboardBackspace", - "KeyboardCapslock", - "KeyboardCommandKey", - "KeyboardControlKey", - "KeyboardDoubleArrowDown", - "KeyboardDoubleArrowLeft", - "KeyboardDoubleArrowRight", - "KeyboardDoubleArrowUp", - "KeyboardHide", - "KeyboardOptionKey", - "KeyboardReturn", - "KeyboardTab", - "KeyboardVoice", - "KingBed", - "Kitchen", - "Kitesurfing", - "Label", - "LabelImportant", - "LabelOff", - "Lan", - "Landscape", - "Landslide", - "Language", - "Laptop", - "LaptopChromebook", - "LaptopMac", - "LaptopWindows", - "LastPage", - "Launch", - "Layers", - "LayersClear", - "Leaderboard", - "LeakAdd", - "LeakRemove", - "LeaveBagsAtHome", - "LegendToggle", - "Lens", - "LensBlur", - "LessThan", - "LessThanEqual", - "LibraryAdd", - "LibraryAddCheck", - "LibraryBooks", - "LibraryMusic", - "Light", - "LightMode", - "Lightbulb", - "LightbulbCircle", - "LineAxis", - "LineStyle", - "LineWeight", - "LinearScale", - "Link", - "LinkOff", - "LinkedCamera", - "Liquor", - "List", - "ListAlt", - "ListView", - "LiveHelp", - "LiveTv", - "Living", - "LmsBook", - "LmsBookComplete", - "LmsCompletionSolid", - "LmsEditSquare", - "LmsEditSquareComplete", - "LmsOutline", - "LmsVideocam", - "LmsVideocamComplete", - "LocalActivity", - "LocalAirport", - "LocalAtm", - "LocalBar", - "LocalCafe", - "LocalCarWash", - "LocalConvenienceStore", - "LocalDining", - "LocalDrink", - "LocalFireDepartment", - "LocalFlorist", - "LocalGasStation", - "LocalGroceryStore", - "LocalHospital", - "LocalHotel", - "LocalLaundryService", - "LocalLibrary", - "LocalMall", - "LocalMovies", - "LocalOffer", - "LocalParking", - "LocalPharmacy", - "LocalPhone", - "LocalPizza", - "LocalPlay", - "LocalPolice", - "LocalPostOffice", - "LocalPrintshop", - "LocalSee", - "LocalShipping", - "LocalTaxi", - "LocationCity", - "LocationDisabled", - "LocationOff", - "LocationOn", - "LocationSearching", - "Lock", - "LockClock", - "LockOpen", - "LockPerson", - "LockReset", - "Locked", - "Login", - "LogoDev", - "Logout", - "Looks", - "Looks3", - "Looks4", - "Looks5", - "Looks6", - "LooksOne", - "LooksTwo", - "Loop", - "Loupe", - "LowPriority", - "Loyalty", - "LteMobiledata", - "LtePlusMobiledata", - "Luggage", - "LunchDining", - "Lyrics", - "MacroOff", - "Mail", - "MailLock", - "MailOutline", - "Male", - "Man", - "Man2", - "Man3", - "Man4", - "ManageAccounts", - "ManageHistory", - "ManageSearch", - "Map", - "MapsHomeWork", - "MapsUgc", - "Margin", - "MarkAsUnread", - "MarkChatRead", - "MarkChatUnread", - "MarkEmailRead", - "MarkEmailUnread", - "MarkUnreadChatAlt", - "Markunread", - "MarkunreadMailbox", - "Masks", - "Maximize", - "MediaBluetoothOff", - "MediaBluetoothOn", - "Mediation", - "MedicalInformation", - "MedicalServices", - "Medication", - "MedicationLiquid", - "MeetingRoom", - "Memory", - "MenuBook", - "MenuIcon", - "MenuOpen", - "Merge", - "MergeType", - "Message", - "Mic", - "MicExternalOff", - "MicExternalOn", - "MicNone", - "MicOff", - "MicrosoftTeams", - "Microwave", - "MilitaryTech", - "Minimize", - "MinorCrash", - "Minus", - "MiscellaneousServices", - "MissedVideoCall", - "Mms", - "MobileFriendly", - "MobileOff", - "MobileScreenShare", - "MobiledataOff", - "Mode", - "ModeComment", - "ModeEdit", - "ModeEditOutline", - "ModeFanOff", - "ModeNight", - "ModeOfTravel", - "ModeStandby", - "ModelTraining", - "MonetizationOn", - "Money", - "MoneyFilled", - "MoneyOff", - "MoneyOffCsred", - "MoneyOutline", - "Monitor", - "MonitorHeart", - "MonitorWeight", - "MonochromePhotos", - "Mood", - "MoodBad", - "Moped", - "More", - "MoreHoriz", - "MoreTime", - "MoreVert", - "Mosque", - "MotionPhotosAuto", - "MotionPhotosOff", - "MotionPhotosOn", - "MotionPhotosPause", - "MotionPhotosPaused", - "Motorcycle", - "Mouse", - "MoveDown", - "MoveToInbox", - "MoveUp", - "Movie", - "MovieCreation", - "MovieFilter", - "Moving", - "Mp", - "MultilineChart", - "MultipleStop", - "Museum", - "MusicNote", - "MusicOff", - "MusicVideo", - "MyLocation", - "Nat", - "Nature", - "NaturePeople", - "NavigateBefore", - "NavigateNext", - "Navigation", - "Nc", - "Nd", - "NearMe", - "NearMeDisabled", - "NearbyError", - "NearbyOff", - "NestCamWiredStand", - "NetworkCell", - "NetworkCheck", - "NetworkLocked", - "NetworkPing", - "NetworkWifi", - "NetworkWifi1Bar", - "NetworkWifi2Bar", - "NetworkWifi3Bar", - "NewLabel", - "NewReleases", - "Newspaper", - "Newsstand", - "NextPlan", - "NextWeek", - "Nfc", - "NightShelter", - "Nightlife", - "Nightlight", - "NightlightRound", - "NightsStay", - "NoAccounts", - "NoAdultContent", - "NoBackpack", - "NoCell", - "NoCrash", - "NoDrinks", - "NoEncryption", - "NoEncryptionGmailerrorred", - "NoFlash", - "NoFood", - "NoLuggage", - "NoMeals", - "NoMeetingRoom", - "NoPhotography", - "NoSim", - "NoStroller", - "NoTransfer", - "NoiseAware", - "NoiseControlOff", - "NordicWalking", - "North", - "NorthEast", - "NorthWest", - "NotAccessible", - "NotEqual", - "NotInterested", - "NotListedLocation", - "NotStarted", - "Note", - "NoteAdd", - "NoteAlt", - "Notes", - "NotificationAdd", - "NotificationImportant", - "Notifications", - "NotificationsActive", - "NotificationsNone", - "NotificationsOff", - "NotificationsPaused", - "Numbers", - "OfflineBolt", - "OfflinePin", - "OfflineShare", - "OilBarrel", - "OnDeviceTraining", - "OndemandVideo", - "OnlinePrediction", - "Opacity", - "OpenInBrowser", - "OpenInFull", - "OpenInNew", - "OpenInNewOff", - "OpenWith", - "OtherHouses", - "Outbond", - "Outbound", - "Outbox", - "OutdoorGrill", - "Outlet", - "OutlinedFlag", - "Output", - "Padding", - "Pages", - "Pageview", - "Paid", - "Palette", - "PanTool", - "PanToolAlt", - "Panorama", - "PanoramaFishEye", - "PanoramaHorizontal", - "PanoramaHorizontalSelect", - "PanoramaPhotosphere", - "PanoramaPhotosphereSelect", - "PanoramaVertical", - "PanoramaVerticalSelect", - "PanoramaWideAngle", - "PanoramaWideAngleSelect", - "Paragliding", - "Park", - "PartyMode", - "Password", - "Pattern", - "Pause", - "PauseCircle", - "PauseCircleFilled", - "PauseCircleOutline", - "PausePresentation", - "Payment", - "Payments", - "Paypal", - "PedalBike", - "Pending", - "PendingActions", - "Pentagon", - "People", - "PeopleAlt", - "PeopleOutline", - "Percent", - "Percentage", - "PermCameraMic", - "PermContactCalendar", - "PermDataSetting", - "PermDeviceInformation", - "PermIdentity", - "PermMedia", - "PermPhoneMsg", - "PermScanWifi", - "Person", - "Person2", - "Person3", - "Person4", - "PersonAdd", - "PersonAddAlt", - "PersonAddAlt1", - "PersonAddDisabled", - "PersonOff", - "PersonOutline", - "PersonPin", - "PersonPinCircle", - "PersonRemove", - "PersonRemoveAlt1", - "PersonSearch", - "PersonalInjury", - "PersonalVideo", - "PestControl", - "PestControlRodent", - "Pets", - "Pgn0", - "Pgn10K", - "Pgn10Mp", - "Pgn11Mp", - "Pgn123", - "Pgn12Mp", - "Pgn13Mp", - "Pgn14Mp", - "Pgn15Mp", - "Pgn16Mp", - "Pgn17Mp", - "Pgn18Mp", - "Pgn18UpRating", - "Pgn19Mp", - "Pgn1K", - "Pgn1KPlus", - "Pgn1XMobiledata", - "Pgn20Mp", - "Pgn21Mp", - "Pgn22Mp", - "Pgn23Mp", - "Pgn24Mp", - "Pgn2K", - "Pgn2KPlus", - "Pgn2Mp", - "Pgn30Fps", - "Pgn30FpsSelect", - "Pgn360", - "Pgn3DRotation", - "Pgn3GMobiledata", - "Pgn3K", - "Pgn3KPlus", - "Pgn3Mp", - "Pgn3P", - "Pgn4GMobiledata", - "Pgn4GPlusMobiledata", - "Pgn4K", - "Pgn4KPlus", - "Pgn4Mp", - "Pgn5G", - "Pgn5K", - "Pgn5KPlus", - "Pgn5Mp", - "Pgn60Fps", - "Pgn60FpsSelect", - "Pgn6FtApart", - "Pgn6K", - "Pgn6KPlus", - "Pgn6Mp", - "Pgn7K", - "Pgn7KPlus", - "Pgn7Mp", - "Pgn8K", - "Pgn8KPlus", - "Pgn8Mp", - "Pgn9K", - "Pgn9KPlus", - "Pgn9Mp", - "Phishing", - "Phone", - "PhoneAndroid", - "PhoneBluetoothSpeaker", - "PhoneCallback", - "PhoneDisabled", - "PhoneEnabled", - "PhoneForwarded", - "PhoneInTalk", - "PhoneIphone", - "PhoneLocked", - "PhoneMissed", - "PhonePaused", - "Phonelink", - "PhonelinkErase", - "PhonelinkLock", - "PhonelinkOff", - "PhonelinkRing", - "PhonelinkSetup", - "Photo", - "PhotoAlbum", - "PhotoCamera", - "PhotoCameraBack", - "PhotoCameraFront", - "PhotoFilter", - "PhotoLibrary", - "PhotoSizeSelectActual", - "PhotoSizeSelectLarge", - "PhotoSizeSelectSmall", - "Php", - "Piano", - "PianoOff", - "PictureAsPdf", - "PictureInPicture", - "PictureInPictureAlt", - "PieChart", - "PieChartOutline", - "Pin", - "PinDrop", - "PinEnd", - "PinInvoke", - "PinOff", - "Pinch", - "PivotTableChart", - "Pix", - "Place", - "Plagiarism", - "PlayArrow", - "PlayCircle", - "PlayCircleFilled", - "PlayCircleFilledWhite", - "PlayCircleOutline", - "PlayDisabled", - "PlayForWork", - "PlayLesson", - "PlaylistAdd", - "PlaylistAddCheck", - "PlaylistAddCheckCircle", - "PlaylistAddCircle", - "PlaylistPlay", - "PlaylistRemove", - "Plumbing", - "Plus", - "PlusMinus", - "PlusMinusAlt", - "PlusOne", - "Podcasts", - "PointOfSale", - "Policy", - "Poll", - "Polyline", - "Polymer", - "Pool", - "PortableWifiOff", - "Portrait", - "Post", - "PostAdd", - "PostOutline", - "Power", - "PowerInput", - "PowerOff", - "PowerSettingsNew", - "PrecisionManufacturing", - "PregnantWoman", - "PresentToAll", - "Preview", - "PriceChange", - "PriceCheck", - "Print", - "PrintDisabled", - "PriorityHigh", - "PrivacyTip", - "PrivateConnectivity", - "ProductionQuantityLimits", - "Program", - "Propane", - "PropaneTank", - "Psychology", - "PsychologyAlt", - "Public", - "PublicOff", - "Publish", - "PublishedWithChanges", - "PunchClock", - "PushPin", - "QrCode2", - "QrCodeScanner", - "Qrcode", - "QueryBuilder", - "QueryStats", - "Question", - "QuestionAnswer", - "QuestionAnswerOutline", - "QuestionMark", - "Queue", - "QueueMusic", - "QueuePlayNext", - "Quickreply", - "Quiz", - "Quora", - "RMobiledata", - "Radar", - "Radio", - "RadioButtonChecked", - "RadioButtonUnchecked", - "RailwayAlert", - "RamenDining", - "RampLeft", - "RampRight", - "RateReview", - "RawOff", - "RawOn", - "ReadMore", - "RealEstateAgent", - "Receipt", - "ReceiptLong", - "RecentActors", - "Recommend", - "Record", - "RecordVoiceOver", - "Rectangle", - "Recycling", - "Reddit", - "Redeem", - "Redo", - "ReduceCapacity", - "Refresh", - "RememberMe", - "Remove", - "RemoveCircle", - "RemoveCircleOutline", - "RemoveDone", - "RemoveFromQueue", - "RemoveModerator", - "RemoveRedEye", - "RemoveRoad", - "RemoveShoppingCart", - "Reorder", - "Repartition", - "Repeat", - "RepeatOn", - "RepeatOne", - "RepeatOneOn", - "Replay", - "Replay10", - "Replay30", - "Replay5", - "ReplayCircleFilled", - "Reply", - "ReplyAll", - "Report", - "ReportGmailerrorred", - "ReportOff", - "ReportOutline", - "ReportProblem", - "RequestPage", - "RequestQuote", - "ResetTv", - "RestartAlt", - "Restaurant", - "RestaurantMenu", - "Restore", - "RestoreFromTrash", - "RestorePage", - "Reviews", - "RiceBowl", - "RightSidebarFilled", - "RightSidebarOutlined", - "RingVolume", - "Rocket", - "RocketLaunch", - "RollerShades", - "RollerShadesClosed", - "RollerSkating", - "Roofing", - "Room", - "RoomPreferences", - "RoomService", - "Rotate90DegreesCcw", - "Rotate90DegreesCw", - "RotateLeft", - "RotateRight", - "RoundaboutLeft", - "RoundaboutRight", - "RoundedCorner", - "Route", - "Router", - "Rowing", - "RssFeed", - "Rsvp", - "Rtt", - "Rule", - "RuleFolder", - "RunCircle", - "RunningWithErrors", - "RvHookup", - "Sa", - "SafetyCheck", - "SafetyDivider", - "Sailing", - "Sanitizer", - "Satellite", - "SatelliteAlt", - "Save", - "SaveAll", - "SaveAlt", - "SaveAs", - "SavedSearch", - "Savings", - "Scale", - "Scanner", - "ScatterPlot", - "Schedule", - "ScheduleSend", - "Schema", - "School", - "SchoolOutline", - "Science", - "Score", - "Scoreboard", - "ScreenLockLandscape", - "ScreenLockPortrait", - "ScreenLockRotation", - "ScreenRotation", - "ScreenRotationAlt", - "ScreenSearchDesktop", - "ScreenShare", - "Screenshot", - "ScreenshotMonitor", - "ScubaDiving", - "Sd", - "SdCard", - "SdCardAlert", - "SdStorage", - "Search", - "SearchOff", - "Security", - "SecurityUpdate", - "SecurityUpdateGood", - "SecurityUpdateWarning", - "Segment", - "SelectAll", - "SelfImprovement", - "Sell", - "Send", - "SendAndArchive", - "SendTimeExtension", - "SendToMobile", - "SensorDoor", - "SensorOccupied", - "SensorWindow", - "Sensors", - "SensorsOff", - "SentimentDissatisfied", - "SentimentNeutral", - "SentimentSatisfied", - "SentimentSatisfiedAlt", - "SentimentSlightlyDissatisfied", - "SentimentVeryDissatisfied", - "SentimentVerySatisfied", - "SetMeal", - "Settings", - "SettingsAccessibility", - "SettingsApplications", - "SettingsBackupRestore", - "SettingsBluetooth", - "SettingsBrightness", - "SettingsCell", - "SettingsEthernet", - "SettingsInputAntenna", - "SettingsInputComponent", - "SettingsInputComposite", - "SettingsInputHdmi", - "SettingsInputSvideo", - "SettingsOverscan", - "SettingsPhone", - "SettingsPower", - "SettingsRemote", - "SettingsSuggest", - "SettingsSystemDaydream", - "SettingsVoice", - "SevereCold", - "ShapeLine", - "Share", - "ShareArrivalTime", - "ShareLocation", - "Shield", - "ShieldMoon", - "Shop", - "Shop2", - "ShopTwo", - "Shopify", - "ShoppingBag", - "ShoppingBasket", - "ShoppingCart", - "ShoppingCartCheckout", - "ShortText", - "Shortcut", - "ShowChart", - "Shower", - "Shuffle", - "ShuffleOn", - "ShutterSpeed", - "Sick", - "SignLanguage", - "SignalCellular0Bar", - "SignalCellular1Bar", - "SignalCellular2Bar", - "SignalCellular3Bar", - "SignalCellular4Bar", - "SignalCellularAlt", - "SignalCellularAlt1Bar", - "SignalCellularAlt2Bar", - "SignalCellularConnectedNoInternet0Bar", - "SignalCellularConnectedNoInternet1Bar", - "SignalCellularConnectedNoInternet2Bar", - "SignalCellularConnectedNoInternet3Bar", - "SignalCellularConnectedNoInternet4Bar", - "SignalCellularNoSim", - "SignalCellularNodata", - "SignalCellularNull", - "SignalCellularOff", - "SignalWifi0Bar", - "SignalWifi1Bar", - "SignalWifi1BarLock", - "SignalWifi2Bar", - "SignalWifi2BarLock", - "SignalWifi3Bar", - "SignalWifi3BarLock", - "SignalWifi4Bar", - "SignalWifi4BarLock", - "SignalWifiBad", - "SignalWifiConnectedNoInternet4", - "SignalWifiOff", - "SignalWifiStatusbar4Bar", - "SignalWifiStatusbarConnectedNoInternet4", - "SignalWifiStatusbarNull", - "Signpost", - "SimCard", - "SimCardAlert", - "SimCardDownload", - "SingleBed", - "Sip", - "Skateboarding", - "SkipNext", - "SkipPrevious", - "Sledding", - "Slideshow", - "SlowMotionVideo", - "SmartButton", - "SmartDisplay", - "SmartScreen", - "SmartToy", - "Smartphone", - "SmokeFree", - "SmokingRooms", - "Sms", - "SmsFailed", - "Snapchat", - "SnippetFolder", - "Snooze", - "Snowboarding", - "Snowmobile", - "Snowshoeing", - "Soap", - "SocialDistance", - "SolarPower", - "Sort", - "SortByAlpha", - "Sos", - "SoupKitchen", - "Source", - "South", - "SouthAmerica", - "SouthEast", - "SouthWest", - "Spa", - "SpaceBar", - "SpaceDashboard", - "SpatialAudio", - "SpatialAudioOff", - "SpatialTracking", - "Speaker", - "SpeakerGroup", - "SpeakerNotes", - "SpeakerNotesOff", - "SpeakerPhone", - "Speed", - "Spellcheck", - "SpinnerIcon", - "SpinnerSimple", - "Splitscreen", - "Spoke", - "Sports", - "SportsBar", - "SportsBaseball", - "SportsBasketball", - "SportsCricket", - "SportsEsports", - "SportsFootball", - "SportsGolf", - "SportsGymnastics", - "SportsHandball", - "SportsHockey", - "SportsKabaddi", - "SportsMartialArts", - "SportsMma", - "SportsMotorsports", - "SportsRugby", - "SportsScore", - "SportsSoccer", - "SportsTennis", - "SportsVolleyball", - "Square", - "SquareFoot", - "SsidChart", - "StackedBarChart", - "StackedLineChart", - "Stadium", - "Stairs", - "Star", - "StarBorder", - "StarBorderPurple500", - "StarFilled", - "StarHalf", - "StarOutline", - "StarPurple500", - "StarRate", - "Stars", - "Start", - "StayCurrentLandscape", - "StayCurrentPortrait", - "StayPrimaryLandscape", - "StayPrimaryPortrait", - "StickyNote2", - "Stop", - "StopCircle", - "StopScreenShare", - "Storage", - "Store", - "StoreMallDirectory", - "Storefront", - "Storm", - "Straight", - "Straighten", - "Stream", - "Streetview", - "StrikethroughS", - "Stroller", - "Style", - "SubdirectoryArrowLeft", - "SubdirectoryArrowRight", - "Subject", - "Subscript", - "Subscriptions", - "Subtitles", - "SubtitlesOff", - "Subway", - "Summarize", - "Superscript", - "SupervisedUserCircle", - "SupervisorAccount", - "Support", - "SupportAgent", - "Surfing", - "SurroundSound", - "SwapCalls", - "SwapHoriz", - "SwapHorizontalCircle", - "SwapVert", - "SwapVerticalCircle", - "Swipe", - "SwipeDown", - "SwipeDownAlt", - "SwipeLeft", - "SwipeLeftAlt", - "SwipeRight", - "SwipeRightAlt", - "SwipeUp", - "SwipeUpAlt", - "SwipeVertical", - "SwitchAccessShortcut", - "SwitchAccessShortcutAdd", - "SwitchAccount", - "SwitchCamera", - "SwitchLeft", - "SwitchRight", - "SwitchVideo", - "Synagogue", - "Sync", - "SyncAlt", - "SyncDisabled", - "SyncLock", - "SyncProblem", - "SystemSecurityUpdate", - "SystemSecurityUpdateGood", - "SystemSecurityUpdateWarning", - "SystemUpdate", - "SystemUpdateAlt", - "TabIcon", - "TabUnselected", - "TableBar", - "TableChart", - "TableRestaurant", - "TableRows", - "TableView", - "Tablet", - "TabletAndroid", - "TabletMac", - "Tag", - "TagFaces", - "TakeoutDining", - "TapAndPlay", - "Tapas", - "Task", - "TaskAlt", - "TaxiAlert", - "Telegram", - "TempleBuddhist", - "TempleHindu", - "Terminal", - "Terrain", - "TextDecrease", - "TextFields", - "TextFormat", - "TextIncrease", - "TextRotateUp", - "TextRotateVertical", - "TextRotationAngledown", - "TextRotationAngleup", - "TextRotationDown", - "TextRotationNone", - "TextSnippet", - "TextToSpeech", - "Textsms", - "Texture", - "TheaterComedy", - "Theaters", - "Thermostat", - "ThermostatAuto", - "ThumbDown", - "ThumbDownAlt", - "ThumbDownOffAlt", - "ThumbUp", - "ThumbUpAlt", - "ThumbUpFilled", - "ThumbUpOffAlt", - "ThumbUpOutline", - "ThumbsUpDown", - "Thunderstorm", - "Tiktok", - "TimeToLeave", - "Timelapse", - "Timeline", - "Timer", - "Timer10", - "Timer10Select", - "Timer3", - "Timer3Select", - "TimerOff", - "TipsAndUpdates", - "TireRepair", - "Title", - "Toc", - "Today", - "ToggleOff", - "ToggleOn", - "Token", - "Toll", - "Tonality", - "Topic", - "Tornado", - "TouchApp", - "Tour", - "Toys", - "TrackChanges", - "Traffic", - "Train", - "Tram", - "Transcribe", - "TransferWithinAStation", - "Transform", - "Transgender", - "TransitEnterexit", - "Translate", - "TravelExplore", - "TrendingDown", - "TrendingFlat", - "TrendingUp", - "TripOrigin", - "Troubleshoot", - "Try", - "Tsunami", - "Tty", - "Tune", - "Tungsten", - "TurnLeft", - "TurnRight", - "TurnSharpLeft", - "TurnSharpRight", - "TurnSlightLeft", - "TurnSlightRight", - "TurnedIn", - "TurnedInNot", - "Tv", - "TvOff", - "TwoWheeler", - "TypeSpecimen", - "UTurnLeft", - "UTurnRight", - "Umbrella", - "Unarchive", - "Undo", - "UnfoldLess", - "UnfoldLessDouble", - "UnfoldMore", - "UnfoldMoreDouble", - "Unlocked", - "Unpublished", - "Unread", - "Unsubscribe", - "Upcoming", - "Update", - "UpdateDisabled", - "Upgrade", - "Upload", - "UploadFile", - "Usb", - "UsbOff", - "Vaccines", - "VapeFree", - "VapingRooms", - "Verified", - "VerifiedBadge", - "VerifiedBadgeOutline", - "VerifiedOutline", - "VerifiedUser", - "VerticalAlignBottom", - "VerticalAlignCenter", - "VerticalAlignTop", - "VerticalDistribute", - "VerticalShades", - "VerticalShadesClosed", - "VerticalSplit", - "Vibration", - "VideoCall", - "VideoCamera", - "VideoCameraBack", - "VideoCameraFront", - "VideoChat", - "VideoFile", - "VideoLabel", - "VideoLibrary", - "VideoSettings", - "VideoStable", - "VideoTranscript", - "Videocam", - "VideocamOff", - "VideocamOutlined", - "VideogameAsset", - "VideogameAssetOff", - "ViewAgenda", - "ViewArray", - "ViewCarousel", - "ViewColumn", - "ViewComfy", - "ViewComfyAlt", - "ViewCompact", - "ViewCompactAlt", - "ViewCozy", - "ViewDay", - "ViewHeadline", - "ViewInAr", - "ViewKanban", - "ViewList", - "ViewModule", - "ViewQuilt", - "ViewSidebar", - "ViewStream", - "ViewTimeline", - "ViewWeek", - "Vignette", - "Villa", - "Visibility", - "VisibilityOff", - "VoiceChat", - "VoiceOverOff", - "Voicemail", - "Volcano", - "VolumeDown", - "VolumeMute", - "VolumeOff", - "VolumeUp", - "VolunteerActivism", - "VpnKey", - "VpnKeyOff", - "VpnLock", - "Vrpano", - "Wallet", - "Wallpaper", - "Warehouse", - "Warning", - "WarningAmber", - "WarningFilled", - "Wash", - "Watch", - "WatchFilled", - "WatchLater", - "WatchOff", - "WatchOutline", - "Water", - "WaterDamage", - "WaterDrop", - "WaterfallChart", - "Waves", - "WavingHand", - "WbAuto", - "WbCloudy", - "WbIncandescent", - "WbIridescent", - "WbShade", - "WbSunny", - "WbTwilight", - "Wc", - "Web", - "WebAsset", - "WebAssetOff", - "WebStories", - "Webhook", - "Wechat", - "Weekend", - "West", - "Whatsapp", - "Whatshot", - "WheelchairPickup", - "WhereToVote", - "Widgets", - "WidthFull", - "WidthNormal", - "WidthWide", - "Wifi", - "Wifi1Bar", - "Wifi2Bar", - "WifiCalling", - "WifiCalling3", - "WifiChannel", - "WifiFind", - "WifiLock", - "WifiOff", - "WifiPassword", - "WifiProtectedSetup", - "WifiTethering", - "WifiTetheringError", - "WifiTetheringErrorRounded", - "WifiTetheringOff", - "WindPower", - "Window", - "WineBar", - "Woman", - "Woman2", - "WooCommerce", - "Wordpress", - "Work", - "WorkHistory", - "WorkOff", - "WorkOutline", - "WorkspacePremium", - "Workspaces", - "WrapText", - "WrongLocation", - "Wysiwyg", - "Yard", - "YoutubeSearchedFor", - "Zoom", - "ZoomIn", - "ZoomInMap", - "ZoomOut", - "ZoomOutMap", - } -) diff --git a/src/openedx_authz/engine/schema/syntax.py b/src/openedx_authz/engine/schema/syntax.py index 361241d80..c3eb35772 100644 --- a/src/openedx_authz/engine/schema/syntax.py +++ b/src/openedx_authz/engine/schema/syntax.py @@ -2,7 +2,7 @@ The schemas own supported ``schema_version`` values, required fields, identifier and permission-reference formats, scope formats, collection shapes, -value types, and Paragon icon-name format. Semantic relationship and icon +value types, and icon identifier format. Semantic relationship and icon membership checks remain in :mod:`.validation`. Each document is validated against the JSON Schema of the ``schema_version`` it diff --git a/src/openedx_authz/engine/schema/validation.py b/src/openedx_authz/engine/schema/validation.py index 829055c1f..e1fdfdc63 100644 --- a/src/openedx_authz/engine/schema/validation.py +++ b/src/openedx_authz/engine/schema/validation.py @@ -6,9 +6,8 @@ * Static role IDs do not start with the prefix reserved for custom roles (ADR 0035). * Roles with no base permissions are accepted with a warning because ``role_extensions`` may contribute their complete permission set. - * ``icon`` values, where present, are valid ``@openedx/paragon/icons`` names - (ADR 0017 §4). The allowed set is vendored in :mod:`paragon_icons` - (regenerate with ``make paragon_icons``; see ADR 0029). + * ``icon`` values, where present, belong to the Open edX AuthZ icon set, + :data:`openedx_authz.constants.icons.AUTHZ_ICONS` (ADR 0039). Whole-set checks (after all documents load): * Every permission ``category`` references an existing category. @@ -39,9 +38,9 @@ from collections.abc import Container from openedx_authz.constants import CUSTOM_ROLE_ID_PREFIX, SchemaOriginKind +from openedx_authz.constants.icons import AUTHZ_ICONS from openedx_authz.engine.schema.dependencies import find_cycles, missing_dependencies from openedx_authz.engine.schema.issues import IssueLevel, ValidationIssue -from openedx_authz.engine.schema.paragon_icons import PARAGON_ICON_NAMES from openedx_authz.engine.schema.types import ( CompiledSchema, PermissionDefinition, @@ -415,19 +414,18 @@ def _check_permission_category( @staticmethod def _check_icon(value: str | None, context: str, sid: str) -> list[ValidationIssue]: - """Validate an optional Paragon icon name (ADR 0017 §4). + """Validate an optional icon identifier (ADR 0039). JSON Schema owns the value's type and format. This check verifies that - the formatted name is one of the vendored ``@openedx/paragon/icons`` - exports (see :mod:`paragon_icons`, ``make paragon_icons``). + the identifier belongs to the Open edX AuthZ icon set. """ if not isinstance(value, str) or not value: return [] - if value not in PARAGON_ICON_NAMES: + if value not in AUTHZ_ICONS: return [ ValidationIssue( IssueLevel.ERROR, - f"{context}: icon {value!r} is not a valid @openedx/paragon/icons name.", + f"{context}: icon {value!r} is not in the Open edX AuthZ icon set.", sid, ) ] diff --git a/src/openedx_authz/tests/api/test_catalog.py b/src/openedx_authz/tests/api/test_catalog.py index 77f23a280..b04aa2ca8 100644 --- a/src/openedx_authz/tests/api/test_catalog.py +++ b/src/openedx_authz/tests/api/test_catalog.py @@ -42,7 +42,7 @@ def setUpTestData(cls): ) cls.editor = AuthzRoleDefinition.objects.create( - role_id="editor", display_name="Editor", description="Edits", icon="Edit", scopes=["course-v1", "lib"] + role_id="editor", display_name="Editor", description="Edits", icon="edit", scopes=["course-v1", "lib"] ) cls.hidden = AuthzRoleDefinition.objects.create(role_id="hidden_role", display_name="Hidden", hidden=True) cls.orphan = AuthzRoleDefinition.objects.create(role_id="orphan", display_name="Orphan") @@ -167,7 +167,7 @@ def test_returns_role_with_grants_in_scope_types(self): "role": "editor", "display_name": "Editor", "description": "Edits", - "icon": "Edit", + "icon": "edit", "definition_kind": DefinitionKind.STATIC.value, "permissions": ["common.manage_team", "courses.view_course"], "scope_types": ["course-v1"], diff --git a/src/openedx_authz/tests/rest_api/test_views.py b/src/openedx_authz/tests/rest_api/test_views.py index ec9915234..470058357 100644 --- a/src/openedx_authz/tests/rest_api/test_views.py +++ b/src/openedx_authz/tests/rest_api/test_views.py @@ -1256,7 +1256,7 @@ def setUp(self): self.client.force_authenticate(user=self.admin_user) self.url = reverse("openedx_authz:role-list") category = AuthzPermissionCategory.objects.create( - category_id="library_content", display_name="Content", description="Library content.", icon="BookOpen" + category_id="library_content", display_name="Content", description="Library content.", icon="book_open" ) unused_category = AuthzPermissionCategory.objects.create(category_id="unused", display_name="Unused") self.assertIsNotNone(unused_category.pk) @@ -1266,7 +1266,7 @@ def setUp(self): display_name="View library", category=category, scopes=["lib"], - icon="RemoveRedEye", + icon="remove_red_eye", ) edit_library = AuthzPermissionDefinition.objects.create( namespace="content_libraries", @@ -1315,7 +1315,7 @@ def test_get_roles_catalog(self): "id": "library_content", "display_name": "Content", "description": "Library content.", - "icon": "BookOpen", + "icon": "book_open", }, ) self.assertEqual( @@ -1328,7 +1328,7 @@ def test_get_roles_catalog(self): "id": "content_libraries.view_library", "display_name": "View library", "description": "", - "icon": "RemoveRedEye", + "icon": "remove_red_eye", "category_id": "library_content", "scope_types": ["lib"], }, diff --git a/src/openedx_authz/tests/schema/test_apply.py b/src/openedx_authz/tests/schema/test_apply.py index b34654c47..ee46419e5 100644 --- a/src/openedx_authz/tests/schema/test_apply.py +++ b/src/openedx_authz/tests/schema/test_apply.py @@ -945,7 +945,7 @@ def test_category_metadata_change_is_reported(self): recategorized = _doc( roles=[role(rid="course_editor", permissions=("courses.view_course",))], - categories=[category("cat", display_name="Course content", icon="Article")], + categories=[category("cat", display_name="Course content", icon="article")], ) plan = self._plan(enforcer, recategorized) diff --git a/src/openedx_authz/tests/schema/test_loading.py b/src/openedx_authz/tests/schema/test_loading.py index 97202b0f8..90fbaca5b 100644 --- a/src/openedx_authz/tests/schema/test_loading.py +++ b/src/openedx_authz/tests/schema/test_loading.py @@ -28,7 +28,7 @@ - id: course_content display_name: Course content description: Course content permissions. - icon: Article + icon: article hidden: true permissions: @@ -398,7 +398,7 @@ def test_extension_hidden_false_is_preserved_as_a_change(self): def test_extension_without_hidden_leaves_it_unset(self): """An extension that omits ``hidden`` leaves it ``None`` (unchanged).""" docs = _load( - b"schema_version: '1.0'\npriority: 1\nrole_extensions:\n - role_id: course_editor\n icon: Article\n" + b"schema_version: '1.0'\npriority: 1\nrole_extensions:\n - role_id: course_editor\n icon: article\n" ) assert docs[0].role_extensions[0].hidden is None diff --git a/src/openedx_authz/tests/schema/test_syntax.py b/src/openedx_authz/tests/schema/test_syntax.py index e027e46b7..7c797af7a 100644 --- a/src/openedx_authz/tests/schema/test_syntax.py +++ b/src/openedx_authz/tests/schema/test_syntax.py @@ -275,9 +275,13 @@ def test_permission_without_a_category_is_error(self): """A permission missing its required category is an error.""" assert validation_messages(permission_data(category_id="")) - @pytest.mark.parametrize("icon", ["remove_red_eye", "removeRedEye", "Remove-Red-Eye", "9Mp lowercase"]) - def test_non_pascalcase_icon_is_error(self, icon): - """An icon name that is not PascalCase is rejected before the export check.""" + def test_snake_case_icon_is_allowed(self): + """Icon identifiers use lowercase snake case (ADR 0039).""" + assert not validation_messages(category_data(icon="remove_red_eye")) + + @pytest.mark.parametrize("icon", ["RemoveRedEye", "removeRedEye", "remove-red-eye", "remove__eye", "9_eye"]) + def test_non_snake_case_icon_is_error(self, icon): + """An icon identifier in any other format is rejected before the membership check.""" assert validation_messages(category_data(icon=icon)) @pytest.mark.parametrize("builder", [category_data, permission_data]) @@ -331,7 +335,7 @@ def test_non_string_icon_is_error(self): } ], ), - schema_data("permission_categories", [{"id": "cat", "icon": "remove_eye"}]), + schema_data("permission_categories", [{"id": "cat", "icon": "RemoveEye"}]), schema_data("permission_categories", [{"id": "cat", "icon": 123}]), ], ) diff --git a/src/openedx_authz/tests/schema/test_validation.py b/src/openedx_authz/tests/schema/test_validation.py index 0357b8f0e..ccac433e5 100644 --- a/src/openedx_authz/tests/schema/test_validation.py +++ b/src/openedx_authz/tests/schema/test_validation.py @@ -4,10 +4,16 @@ scope rules, required fields, extension references, and post-compile validation. """ +import re +from pathlib import Path + import pytest +from openedx_authz.constants.icons import AUTHZ_ICONS from openedx_authz.engine.schema.compilation import SchemaCompiler -from openedx_authz.engine.schema.paragon_icons import PARAGON_ICON_NAMES +from openedx_authz.engine.schema.discovery import SchemaDiscovery +from openedx_authz.engine.schema.loading import SchemaLoader +from openedx_authz.engine.schema.parsing import SchemaParser from openedx_authz.engine.schema.types import SchemaDocument from openedx_authz.engine.schema.validation import SchemaValidator @@ -654,21 +660,18 @@ def test_hidden_permission_may_depend_on_hidden_or_visible_permissions(self): class TestIconRules: - """ADR 0017 §4: icon names must be valid @openedx/paragon/icons names.""" + """ADR 0039: icon values must belong to the Open edX AuthZ icon set.""" - # Pick a known-valid icon name dynamically instead of hardcoding a specific icon. - # This makes the tests resilient if a future paragon upgrade removes the icon we - # might have chosen. We use the first icon in the frozenset (sorted for stability). - _VALID_ICON = sorted(PARAGON_ICON_NAMES)[0] + _VALID_ICON = "visibility" def test_valid_category_icon_has_no_errors(self): - """A real Paragon icon name on a category passes validation.""" + """An identifier from the icon set on a category passes validation.""" doc = make_document(categories=[category("cat", icon=self._VALID_ICON)]) assert not _errors(SchemaValidator().validate([doc])) def test_valid_permission_icon_has_no_errors(self): - """A real Paragon icon name on a permission passes validation.""" + """An identifier from the icon set on a permission passes validation.""" doc = make_document( categories=[category("cat")], permissions=[permission(cat="cat", icon=self._VALID_ICON)], @@ -677,13 +680,13 @@ def test_valid_permission_icon_has_no_errors(self): assert not _errors(SchemaValidator().validate([doc])) def test_valid_role_icon_has_no_errors(self): - """A real Paragon icon name on a role passes validation.""" + """An identifier from the icon set on a role passes validation.""" doc = make_document(roles=[role(icon=self._VALID_ICON)]) assert not _errors(SchemaValidator().validate([doc])) def test_valid_role_extension_icon_has_no_errors(self): - """A real Paragon icon name on a role_extension passes validation.""" + """An identifier from the icon set on a role_extension passes validation.""" base = make_document( "base", categories=[category("cat")], @@ -701,35 +704,43 @@ def test_missing_icon_is_allowed(self, icon): assert not _errors(SchemaValidator().validate([doc])) - def test_unknown_but_wellformed_icon_is_error(self): - """A PascalCase name that Paragon does not export is rejected.""" - doc = make_document(categories=[category("cat", icon="NotARealParagonIcon")]) + @pytest.mark.parametrize("icon", ["arrow_back", "menu", "image", "spinner", "lms_book", "institution"]) + def test_identifiers_from_the_proposal_are_accepted(self, icon): + """Identifiers drop Paragon's naming, including its ``Icon`` suffix.""" + doc = make_document(categories=[category("cat", icon=icon)]) + + assert not _errors(SchemaValidator().validate([doc])) + + @pytest.mark.parametrize("icon", ["not_a_real_icon", "menu_icon", "plus", "local_offer"]) + def test_unknown_but_wellformed_icon_is_error(self, icon): + """A well-formed identifier outside the set is rejected.""" + doc = make_document(categories=[category("cat", icon=icon)]) messages = [i.message for i in _errors(SchemaValidator().validate([doc]))] - assert any("is not a valid @openedx/paragon/icons name" in m for m in messages) + assert any("is not in the Open edX AuthZ icon set" in m for m in messages) def test_permission_icon_is_validated(self): """A permission's icon is validated and the error names the permission.""" doc = make_document( categories=[category("cat")], - permissions=[permission(cat="cat", icon="NotARealParagonIcon")], + permissions=[permission(cat="cat", icon="not_a_real_icon")], ) messages = [i.message for i in _errors(SchemaValidator().validate([doc]))] assert any( - "permission courses.view_course" in message and "not a valid @openedx/paragon/icons" in message + "permission courses.view_course" in message and "is not in the Open edX AuthZ icon set" in message for message in messages ) def test_role_icon_is_validated(self): """A role's icon is validated and the error names the role.""" - doc = make_document(roles=[role(icon="NotARealParagonIcon")]) + doc = make_document(roles=[role(icon="not_a_real_icon")]) messages = [i.message for i in _errors(SchemaValidator().validate([doc]))] - assert any("role course_editor" in m and "not a valid @openedx/paragon/icons" in m for m in messages) + assert any("role course_editor" in m and "is not in the Open edX AuthZ icon set" in m for m in messages) def test_role_extension_icon_is_validated(self): """A role_extension may set an icon, so its value is checked too.""" @@ -739,8 +750,23 @@ def test_role_extension_icon_is_validated(self): permissions=[permission(cat="cat")], roles=[role()], ) - ext = make_document("ext", role_extensions=[extension("course_editor", icon="NotARealParagonIcon")]) + ext = make_document("ext", role_extensions=[extension("course_editor", icon="not_a_real_icon")]) messages = [i.message for i in _errors(SchemaValidator().validate([base, ext]))] assert any("role_extension course_editor" in m for m in messages) + + def test_shipped_documents_pass_validation(self): + """Every authorization document shipped by this package uses the icon set.""" + documents = SchemaLoader().load(SchemaParser().parse(SchemaDiscovery().discover())) + + assert documents + assert not _errors(SchemaValidator().validate(documents)) + + def test_documented_icons_match_the_icon_set(self): + """The extension API reference lists exactly the identifiers validation accepts.""" + reference = Path(__file__).parents[4] / "docs" / "references" / "icons.rst" + + documented = re.findall(r"^ \* - ``(\w+)``$", reference.read_text(encoding="utf-8"), re.MULTILINE) + + assert sorted(documented) == sorted(AUTHZ_ICONS)