Access Check performed on all entity queries

Created on 5 September 2024, 24 days ago
Updated 6 September 2024, 23 days ago

Problem/Motivation

Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck(). in Drupal\Core\Entity\Query\Sql\Query->prepare() (line 142 of /app/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

When saving an groups permissions Drupal throws an entity query exception on line 39 of group_permissions/src/Plugin/Validation/Constraint/UniqueReferenceFieldValidator.php.

Steps to reproduce

Set permissions at a group type level and then modify those permissions at the group level.

Proposed resolution

Needs ->accessCheck(TRUE) before the ->execute(); on line 39.

See Access checking must be explicitly specified on content entity queries β†’ for more info.

Remaining tasks

I'm unsure if there are any other entity queries within the module that need to be updated as well.

πŸ› Bug report
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States glaze Minnesota

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024