-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Description
In MongoDB Realm, setting insert: true on a role was sufficient to allow document inserts, regardless of field-level write permissions. In Flowerbase, inserts are rejected unless the role also has write permissions — either at the top level or on each individual field.
Steps to Reproduce
Define a role with insert: true but field-level permissions that only specify read: true:
{
"name": "ExampleRole",
"apply_when": { "%%user.custom_data.type": "someType" },
"fields": {
"name": { "read": true },
"value": { "read": true }
},
"insert": true,
"delete": false,
"search": true,
"additional_fields": {}
}
Attempt to insert a document as a user matching this role.
Expected Behavior
Insert succeeds — insert: true grants permission to create documents, field-level read/write controls which fields can be read or updated on existing documents.
This matches MongoDB Realm's behavior where insert was an independent permission.
Actual Behavior
Insert fails with "Insert not permitted".