-
-
Couldn't load subscription status.
- Fork 126
Closed
Description
Description and expected behavior
When the policy withPolicy is set with the relation id filed, following error happened:
@@allow('all', auth().id == tenant_id)
}Screenshots
{
"data": {
...
"tenant": {
"connect": {
"id": "52262a1c-23d2-40ed-9e9f-ddb76a623e1a"
}
}
}
}
[Nest] 8986 - 08/13/2023, 9:50:50 AM ERROR [ExceptionsHandler] denied by policy: equipment entities failed 'create' check
Error calling enhanced Prisma method `create`: denied by policy: equipment entities failed 'create' checkEnvironment (please complete the following information):
- ZenStack version: 1.0.0-beta.16
- Prisma version: 5.0.0
- Database type: Postgresql
Additional context
I'm using a Nestjs application.
@ymc9 Helped me in Discord:
I believe it's a regression since beta.15 release.
The "create" is incorrectly rejected because the rule mishandled the case of tenent_id field and the "connect" semantics.
...
the policy engine is supposed to treat a relation and the corresponding foreign key in the same way
...
ymc9
Metadata
Metadata
Assignees
Labels
No labels