Replies: 4 comments 1 reply
-
The Ability Configuration returns following while using {"OR":[{"OR":[{"id":2},{"teams":{"some":{"id":{"in":[1,2]}}}}]} The prisma findMany returned results are as expected using the above. |
Beta Was this translation helpful? Give feedback.
-
Is the "connect" notation in createInput, processed correctly within @casl/prisma to match the condition? |
Beta Was this translation helpful? Give feedback.
-
@stalniy ,
|
Beta Was this translation helpful? Give feedback.
-
Currently moved to using a workaround to test only the validation fields as per conditions. // ability is created for the user as referenced above
// const isAllowed = ability.can("create", subject("Person", createInput)); // 👈 isAllowed is false
// passing only validation fields as per the conditions
const isAllowed = ability.can("create", subject("Person", {teams: [ createInput.teams.connect ] )); // 👈 isAllowed is *true*
|
Beta Was this translation helpful? Give feedback.
-
Person has many to many relation with Team. And Team member Person can "manage" own Team member Person.
👇 - Prisma schema example:
👇 - Ability configuration
👇 - Ability check for action create
❓ What is wrong in the ability configuration that causes the return value false?
Using @casl/prisma along with @casl/ability as per the guides.
Beta Was this translation helpful? Give feedback.
All reactions