zenstack
zenstack copied to clipboard
[Feature Request] `check()` function support for to-many relations
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
@ymc9 @jiashengguo any update on check for to-many relations?