Problem/Motivation

The following line:
$result = $result->andIf(AccessResult::forbidden('The entity is locked'));
changes the max age that was previously set to 0 to -1, causing the access check to be cached while it shouldn't.

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

dieterholvoet created an issue. See original summary.

dieterholvoet’s picture

Status: Active » Needs review
dieterholvoet’s picture

Assigned: dieterholvoet » Unassigned

alexpott made their first commit to this issue’s fork.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

I've added test coverage.

  • alexpott committed f3bffbf3 on 3.x
    fix: #3556448 Access check returns wrong cacheability metadata when the...
alexpott’s picture

Status: Reviewed & tested by the community » 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.