-
-
Notifications
You must be signed in to change notification settings - Fork 106
Polymorphic sub model enhancements ignoring #1710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @svetch , many thanks for reporting this issue! You're right, when reading a polymorphic entity via a base model, As for the update scenario, it's actually not a supported scenario to directly manipulate the |
… querying with a delegate model Fixes #1710
Fixed in 2.6.0 |
Description and expected behavior
example model:
Now if I get first user without zenstack context, then its works correctly.
BUT for the profile queries the sub models access policies don't validate, and also includes the omitted fields of submodel.
And also you can update the sub model fields without any permission check.
Possible solution
I figured out that the issue occurs because the model metadata does not include the delegate relational fields. As a result, all enhancements that should be applied to these fields are ignored, and permissions for both reading and writing are automatically granted.
To resolve this problem, the generator CLI plugin needs to be updated to ensure that the delegate relational fields are included in the model metadata, not just in the Prisma schema.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: