Skip to content

Remove unsupported $eqi from RBAC condition operators - #3391

Merged
pwizla merged 2 commits into
mainfrom
fix/rbac-conditions-remove-unsupported-eqi
Aug 24, 2026
Merged

Remove unsupported $eqi from RBAC condition operators#3391
pwizla merged 2 commits into
mainfrom
fix/rbac-conditions-remove-unsupported-eqi

Conversation

@butcherZ

@butcherZ butcherZ commented Aug 24, 2026

Copy link
Copy Markdown
Member

Description

The RBAC custom-conditions guide listed $eqi as a supported operator for condition query objects, but it is not supported.

RBAC condition query objects are matched in-memory by sift.js through a restricted operator whitelist defined in packages/core/permissions/src/engine/abilities/casl-ability.ts:

const allowedOperations = [
  '$or', '$and', '$eq', '$ne', '$in', '$nin',
  '$lt', '$lte', '$gt', '$gte', '$exists', '$elemMatch',
] as const;

const operations = pick(allowedOperations, sift);
const conditionsMatcher = (conditions) => sift.createQueryTester(conditions, { operations });

$eqi is absent from that list. Any operator outside the whitelist ($eqi, $contains, $startsWith, $null, …) causes sift to throw Unsupported operation: <op> when the condition is evaluated on a create/update/delete/publish, so a "read-valid" condition can hard-fail write operations.

This PR:

  • Removes $eqi from the supported-operators list so it matches the code whitelist.
  • Adds a caution clarifying that the list is exhaustive and that filter operators available in the REST/Query Engine APIs (e.g. $eqi, $contains, $startsWith, $null) are not usable in RBAC condition query objects and will throw when evaluated.

Related issue(s)/PR(s)

EE-115

@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview Aug 24, 2026 2:22pm

Request Review

Comment thread docusaurus/docs/cms/configurations/guides/rbac.md Outdated
@pwizla pwizla changed the title docs(rbac): remove unsupported $eqi from RBAC condition operators Aug 24, 2026
@pwizla pwizla self-assigned this Aug 24, 2026
@pwizla pwizla added this to the 7.1.0 milestone Aug 24, 2026
@pwizla

pwizla commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Thanks, Ziyi! I'm merging it 🚀

@pwizla
pwizla merged commit c334e9a into main Aug 24, 2026
3 of 4 checks passed
@pwizla
pwizla deleted the fix/rbac-conditions-remove-unsupported-eqi branch August 24, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal PRs created by the Strapi core team pr: chore source: CMS

2 participants