Web Developer
Hello everyone,
I am currently a little bit confused on how to define an array of Permissions that I can use in a database.createDocument() statement. I included a short code snippet to demonstrate my problem:
memberArray.forEach((member) = > { permissions.push(Permission.read(Role.user(member.userId)));});createDocument = await databases.createDocument( "<database>", "<collection>", ID.unique(), {data}, permissions);```
I've tried several different alternatives including mapping the array directly in the `createDocument()` function, or using an array of strings like `read("user:<id>)`Nothing seems to work, the error message is always the same: `Error creating document: [AppwriteException: Permissions must be one of: (any, users, user:<censored>, user:<censored>/unverified, users/unverified)]`
I would be very very grateful if somebody could help me out, because I am starting to feel a little bit dumb 🥲