Is your feature request related to a problem? Please describe.
The v3 documentation mentions:
and you can also define your own functions in the schema.
However, there are no examples showing how to actually do this. It's currently hard to figure out the correct syntax for parameters, return types, and how to use them inside policies.
Describe the solution you'd like
It would be great to add a short code snippet to the functions page demonstrating:
- How to declare a custom function in the
.zmodel file.
- How to call it inside a policy rule (e.g.,
@allow).
Describe alternatives you've considered
Trying to guess the syntax via trial and error or searching for examples in the Discord community.
Additional context
https://zenstack.dev/docs/reference/zmodel/function
Is your feature request related to a problem? Please describe.
The
v3documentation mentions:However, there are no examples showing how to actually do this. It's currently hard to figure out the correct syntax for parameters, return types, and how to use them inside policies.
Describe the solution you'd like
It would be great to add a short code snippet to the functions page demonstrating:
.zmodelfile.@allow).Describe alternatives you've considered
Trying to guess the syntax via trial and error or searching for examples in the Discord community.
Additional context
https://zenstack.dev/docs/reference/zmodel/function