Cannot rule with properties not included in query #948
-
Hi,
If I get their query via
And if I try to get omitted or permitted properties I use However if I leave out the property from cannot rule:
It results in this query:
Is there some logic behind it or is this a bug? I think there might be similar issues when using
since permittedFields will return nothing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Fresh from the oven: https://www.npmjs.com/package/prisma-extension-casl |
Beta Was this translation helpful? Give feedback.
OK, let's step back to this particular example:
and say it in human language:
The issue with this statement is that you cannot read User with id = 1 at all :) What you should say instead is
In this case on conditions level you will get
{ id: { IN: [0, 1] } }
which is correct and fields you will need to filter out on client side or create a complexswitch/case
statement (which is not possible in cross db env I guess)