Open nwidynski opened 7 months ago
we would have to extend a common base model, which it then complains is extended from multiple times.
Would you please give us an example for this?
Maybe something like "partial models" can mitigate this problem? Like:
model Post {
id Int @id
title String
}
model Post {
@@allow(...)
}
The two Post
models can reside in different zmodel files and are merged during compilation.
we would have to extend a common base model, which it then complains is extended from multiple times.
Would you please give us an example for this?
I updated the description.
Maybe something like "partial models" can mitigate this problem? Like:
model Post { id Int @id title String } model Post { @@allow(...) }
The two
Post
models can reside in different zmodel files and are merged during compilation.
Is this something that is working already? I'm asking because there is nothing in the docs about this.
Maybe something like "partial models" can mitigate this problem? Like:
model Post { id Int @id title String } model Post { @@allow(...) }
The two
Post
models can reside in different zmodel files and are merged during compilation.Is this something that is working already? I'm asking because there is nothing in the docs about this.
No, it's just a proposal😄. Sorry for causing confusion.
Maybe something like "partial models" can mitigate this problem? Like:
model Post {
id Int @id
title String
}
model Post {
@@Allow(...)
}
The two
Post
models can reside in different zmodel files and are merged during compilation.Is this something that is working already? I'm asking because there is nothing in the docs about this.
No, it's just a proposal😄. Sorry for causing confusion.
Thought so 😄 . But yeah, a partial merge during compilation would be much appreciated.
Got it. I've put it into V2 milestone and will continue prioritize.
Is your feature request related to a problem? Please describe. When developing complex access policies or validation a single zmodel can quickly get very chaotic.
Describe the solution you'd like A way to put model-level access policies and validation in a separate file or abstract model.
Describe alternatives you've considered We tried creating abstract models, which contain the model-level policies, but for Zenstack to recognize the fields we would have to extend a common base model, which it then complains is extended from multiple times.