isAccessAllowed() method always returns allowed due to recursive entity checks (permissions_by_entity)

Created on 9 May 2025, 3 months ago

Problem/Motivation

The Permissions by Entity module's isAccessAllowed() method can incorrectly return TRUE during recursive entity checks. This happens when referenced entities contain taxonomy term reference fields that are not restricted by the configured target_bundles in the Permissions by Term module. As a result, access may be unintentionally granted.

Steps to reproduce

* Add a entity_reference field to a media item that references one of the target_bundles configured.
* Add another entity_reference field that references a vocabulary not configured as a permissions_by_term target_bundle.
* add an access control term to a media item, and view the media item as a user who is not supposed to have access to that term.

Proposed resolution

* During recursive access checks, validate that entity_reference fields being evaluated match the configured target_bundles from permissions_by_term.settings.
* Skip the parent field on taxonomy term entities during recursive checks to prevent unnecessary evaluation and potential circular references.

๐Ÿ› Bug report
Status

Active

Version

3.1

Component

Code

Created by

๐Ÿ‡ฆ๐Ÿ‡บAustralia carlopogus

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