- Issue created by @tstoeckler
In \Drupal\entity\EntityPermissionProviderBase::buildPermissions()
we check the permission granularity of the entity type to provider either entity-type-level permissions or bundle-level permissions.
However, we never check the permission granularity anywhere in \Drupal\entity\QueryAccess\QueryAccessHandlerBase
. Instead we check both the entity-type-level and the bundle-level permissions there. Thus, this is not a bug, as far as I can tell, but it does result in unnecessary checks.
I guess most people won't hit this, because the default query access doesn't really provide any benefit for entities with entity-type-level permissions, but it's annoying if you want to provide an extended query access handler that should be able to work with both permission schemes and you want to extend QueryAccessHandlerBase
.
-
Check $entity_type->getPermissionGranularity()
in QueryAccessHandlerBase
and adapt the logic accordingly.
-
-
-
Active
1.0
Entity CRUD controller