return AccessResult::allowedIf($routeMatch && $routeMatch->getRawParameter('user') == $account->id());

says that is depends on the current user account, but this information is not present.

Suggested fix:

  $access = AccessResult::allowedIf($routeMatch && $routeMatch->getRawParameter('user') == $account->id());
  $access->addCacheContexts(['user']);

  return $access;

Comments

Fabianx created an issue. See original summary.

  • Boobaa committed 9b5bd77 on 8.x-1.x
    Issue #2609162 by Fabianx: Fixed OwnDataAccessCheck misses cacheability...
boobaa’s picture

Status: Active » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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