Add caching for access results

Created on 5 May 2023, over 1 year ago
Updated 10 May 2023, over 1 year ago

Problem/Motivation

Currently we're not caching access results. In https://www.drupal.org/project/access_by_ref I saw:

return AccessResult::allowed()
                ->cachePerPermissions()
                ->cachePerUser()
                ->addCacheableDependency($entity);

https://git.drupalcode.org/project/access_by_ref/-/blob/9.x-3.x/access_b...

We could do similar but have to be 100% sure we understand what we're doing and our logic is correct. Otherwise wrong access results could be returned, leading to dangerous information disclosure!
Furthermore this is hard to test with caching, so the logic must fit!

@Grevil could you read into this caching logic and determine the correct conditions for our case?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Comments & Activities

Production build 0.71.5 2024