This is arguably a bug report, but that's not really that important, so going with the less debatable category...

It is very confusing that core encourages to declare an admin permission - and in fact requires it if you want to get the auto-generated collection route - but the permission provider that ships with this module hardcodes a "administer $entity_type_id" permission.

I think we should support the declared admin permission instead.

CommentFileSizeAuthor
#2 3065464-2.patch10.27 KBtstoeckler
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tstoeckler created an issue. See original summary.

tstoeckler’s picture

Status: Active » Needs review
FileSize
10.27 KB

Here's a patch that adds support for the admin permission in BundleEntityAccessControlHandler, EntityAccessControlHandlerBase, EntityPermissionProviderBase and QueryAccessHandlerBase.

I implemented it in a way that it falls back to the previously generated "administer $entity_type_id" permission if no admin permission is provided. To be honest, I find it a bit strange to generate any admin permission at all if the permission is not declared, but I guess that would break BC at this point.

  • bojanz committed 61feb33 on 8.x-1.x authored by tstoeckler
    Issue #3065464 by tstoeckler: Support the declared admin_permission in...
bojanz’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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