-
-
Notifications
You must be signed in to change notification settings - Fork 137
Many-to-many update check failing with connect #2531
Copy link
Copy link
Open
Description
Description and expected behavior
When trying to create and connect an object, in the same operation, which has the following policy:
@@allow('read,update', auth() != null && parents?[id == auth().id])
The create fails with a model not updatable error:
ORMError: many-to-many relation participant model "Child" not updatable
The read back should succeed though, as the parent would be connected as part of the operation:
const child = await authedClient.child.create({
data: {
name: "Child",
parents: {
connect: { id: userId },
},
},
});
Environment:
- ZenStack version: 3.5.2
- Database type: Postgres / SQLite
- Node.js version: 24.11.1
- Package manager: npm
Additional context
There's a reproduction repo here: https://github.com/f8k8/ZenstackConnectPermissionIssue
Running npm install will install the dependencies and seed the database, then run npm run start to see the error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels