zenstack icon indicating copy to clipboard operation
zenstack copied to clipboard

[Feature Request] `check()` function support for to-many relations

Open jason-curtis opened this issue 1 year ago • 1 comments

As explained in this blog post, the check() function is a great way to simplify access rules with complex sets of models. However it is not implemented yet for to-many relations.

Describe the solution you'd like Much like check(author) checks if the model referenced by the author field is accessible, check(children?) should check if any of the related children are accessible. Other Collection Predicate Expressions should work similarly.

Other syntax options are also discussed in the blog post and its comment thread: https://github.com/zenstackhq/zenstack-docs/discussions/360

jason-curtis avatar Sep 06 '24 16:09 jason-curtis

@ymc9 @jiashengguo any update on check for to-many relations?

zgeorge22 avatar Jul 14 '25 16:07 zgeorge22