Problem/Motivation

All routes of the module require the permission administer earkiv_archive entity, but the module defines administer earkiv entities in earkiv.permissions.yml, which is also the admin_permission of both entity types. The permission in the routes does not exist and cannot be granted, so only user 1 and administrator roles can use the module. A user with the defined permission gets 403 on every page, but can still download the archive files, since file access follows the entity access.

The menu link of the settings page is placed under Content authoring (system.admin_config_content), while the page is at /admin/config/services/earkiv, under Web services.

Steps to reproduce

  1. Create a role with the permission "Administer E-Arkiv entities" and a user with that role.
  2. Log in as the user and go to /admin/content/earkiv or /admin/config/services/earkiv.
  3. Access is denied.

Proposed resolution

  • Use administer earkiv entities for the settings page and the list pages.
  • Use entity access for the add and delete forms (_entity_create_access and _entity_access), so that they follow the access handler of the entity types.
  • Move the menu link of the settings page to Web services (system.admin_config_services).

Remaining tasks

  • Review.

User interface changes

The settings page is listed under Configuration > Web services. Users with "Administer E-Arkiv entities" can use the module.

API changes

None.

Data model changes

None.

AI-Generated: Yes (Used Claude Code to find the cause and draft this issue.)

Issue fork earkiv-3636840

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

thomas alsén created an issue. See original summary.

  • thomas alsén committed 2311c3d6 on 1.0.x
    fix: #3636840 Routes require a permission that does not exist
    
thomas alsén’s picture

Status: Active » Fixed

Merged into 1.0.x!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.