See parent issue #3200985: [meta] Fix undesirable access checking on entity query usages for context and test coverage policy.

The user_is_blocked() function should report accurately on the user's status regardless of whether the current user has 'view' access on the user.

core/modules/user/user.module user_is_blocked

Issue fork drupal-3203366

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jonathanshaw created an issue. See original summary.

jonathanshaw’s picture

jonathanshaw’s picture

Status: Active » Needs review

There is no existing test coverage for this function, the usages of it in core do not lead to data integrity problems even with the bug, and you'd need to be doing something very custom to encounter this. Therefore I suggest that under the test coverage policy in the parent issue, we don't add a test here.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Agree with everything in #3.

alexpott’s picture

Version: 9.2.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed cc9a7d8604 to 9.2.x and 661c73b35e to 9.1.x. Thanks!

I agree that trying to tease out test coverage here is not worth it and we can allow this to be committed without it. Especially as do hook_query_user_access_alter is not even present in contrib - http://codcontrib.hank.vps-private.net/search?text=query_user_access_alt...

  • alexpott committed cc9a7d8 on 9.2.x
    Issue #3203366 by jonathanshaw: EntityQuery accessCheck: user_is_blocked...

  • alexpott committed 661c73b on 9.1.x
    Issue #3203366 by jonathanshaw: EntityQuery accessCheck: user_is_blocked...

Status: Fixed » Closed (fixed)

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