Clean up code in UserRolesCacheContext::getContext()

Created on 11 January 2025, 4 months ago

Problem/Motivation

In #3436395-37: UserRolesCacheContext can lead to poisoned cache returns for user 1 β†’ , @alexpott wrote,

FWIW it would great to file a follow up to add a TRUE to the in_array in this code.

Personally, I am bothered by this line, a little further down:

      return (in_array($role, $this->user->getRoles()) ? 'true' : 'false');

I am sure that at least one core committer will say that the else after a return should be removed.

Proposed resolution

Clean up the code.

Remaining tasks

User interface changes

None

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

N/A

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

cache system

Created by

πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024