Problem/Motivation

subscription_manager.permissions.yml defines administer subscription manager, administer subscription plans, administer subscriptions, and manage own subscriptions. But the code references four permissions that do not exist anywhere:

  • administer Subscription entities — the subscription entity's admin_permission, also used by its settings-form route (the Field UI base route).
  • administer subscription plan entities — the subscription_plan entity's admin_permission, same settings-route usage.
  • access Subscription overview — requirement on the /admin/content/subscription collection route.
  • access Subscription plan overview — requirement on the /admin/content/subscription-plan collection route.

Since no role can hold an undefined permission, both collection listings, both settings forms, and Field UI for both entity types are reachable only by user 1. It fails safe (deny), so this is an availability bug rather than a vulnerability, but any real admin role is locked out of half the module's admin UI.

Steps to reproduce

  1. Create a role with every permission the module defines; assign it to a non-uid-1 user.
  2. Visit /admin/content/subscription or /admin/structure/subscription/settings as that user: 403.

Proposed resolution

Standardize on the defined permissions rather than defining four new ones: set the subscription entity's admin_permission and collection-route requirement to administer subscriptions, and the subscription_plan equivalents to administer subscription plans. This matches what the access control handlers already check for entity operations, so one permission governs each entity type consistently. Audit links.menu/task/action files for the same strings.

Remaining tasks

Patch; kernel test asserting a role with administer subscriptions can reach the collection and settings routes; change record noting the effective permission consolidation.

User interface changes

Admin collections and settings become reachable by appropriately-permissioned roles.

API changes

None.

Data model changes

None.

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

colan created an issue. See original summary.

colan’s picture

colan’s picture

MR opened, taking the consolidation route from the proposed resolution: the subscription entity's admin_permission and collection-route requirement become administer subscriptions, and the subscription_plan equivalents become administer subscription plans — the same permissions the access control handlers already check, so one permission now governs each entity type consistently. The settings-form routes read getAdminPermission(), so they follow automatically, and the audit of the links.menu/task/action files found route references only (no permission strings), so nothing to change there.

AdminRoutePermissionsTest asserts each admin route (collection and settings, both entity types) is reachable with its defined permission, not reachable with the other entity type's permission or by a permissionless user, and that both admin_permission values exist in the defined-permissions list.

Since the four removed strings never existed as permissions, no role can have them assigned, so there is nothing to migrate — the change record can note the consolidation for anyone who granted the strings via custom code.

colan’s picture

Status: Active » Needs review

  • colan committed c53b939f on 1.0.x
    Issue #3616930: Consolidate admin routes onto the defined permissions...
colan’s picture

Status: Needs review » Fixed

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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.