When i try to create a document with custom permissions it throws me the error: Permissions must be one of: (any, guests).
why does this is happening?
A user cannot grant permissions they do not have. In your case here, the user is unauthenticated so they can't put user uuid242
thanks Steven for the reply
a user can't give themselves update permissions if the collection permissions doesn't allow it, right?
For example, my user is already authenticated in my app and I want to update a value in a document that only my authenticated user is allowed to update, that means that nobody can update that document because it does not correspond to them. My idea is that this document has an update permission for my authenticated user and I assign that permission to him when I create the document.
However, as a user cannot be granted permissions that they do not have, then I get an error that I cannot add the update permission for that document.
The error goes away if I put allow update for all users in the collection permissions, however it is not what I want since anyone could update documents from others and that would be a security breach.
How could I create the document with update permissions only for my authenticated user, without having to allow the entire collection permissions to update?
Also if it helps this are my collection permissions:
You need to enable document level permissions and allow users to create documents. When they create the document, they can put themselves for update access so they can update.
The error in your original post is occurring because you're not authenticated
The document level permissions is activated through the Document Security tab? I attach photo, like this?
And with that activated, then when a user, being authenticated in the app, creates the document, do I manually assign the "update document" permission or is it assigned by itself?
Hi @Steven. My collection has document level permission enabled and have create permission for any. but i'm still getting the same error. any idea what's happening?
please create a new post instead of posting in someone else's thread
by default, if you don't pass any permissions, the user creating the document gets update, read, and delete access
is there anything else you need or can this be marked as solved?
[SOLVED] Permissions must be one of (any, guests)
Recommended threads
- Seed db
hello there... is this correct way to seed appwrite
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...