stalniy / casl

CASL is an isomorphic authorization JavaScript library which restricts what resources a given user is allowed to access
https://casl.js.org/
MIT License
5.74k stars 257 forks source link

How to perform conditions on nested objects? #914

Closed hugomendonca98 closed 1 month ago

hugomendonca98 commented 1 month ago

Hello, I'm trying to access properties in nested objects and perform conditions, but I can't do this.

builder.can("VIEW_POST_TAGS", "PUBLICATION", { creator: { role: { $ne: "CONTENT_CREATOR" } }, });

stalniy commented 1 month ago

https://casl.js.org/v6/en/guide/conditions-in-depth#match-nested-property-value