My collection has Create and Read permissions for Any. but still, when i try to add a doc giving update and delete permission to a specific user, it throws the above error. the error doesn't pop up if I don't pass any permissions. but in that case, no user will be able to update/delete that doc. any idea why it's happening and how to solve it?
lemme know if any more info is needed
Framework: NextJS@13 Appwrite: Cloud
Is this related? https://discord.com/channels/564160730845151244/1169138259180396604
yeah kinda. the only difference is, OP facing this issue with functions, while i'm with documents. but what OP described as the reason after a few replies, doesn't really make sense to me tbh. the document has Create access to Any, which means anyone can create documents in that collection. then why i can't set permissions for the new doc while creating that?
sure you have permissions to create, but that doesn't mean you can create anything you want. just like how to can't put a string bigger than the size or an enum value that isn't defined.
A user cannot set a permission they do not have
I figured this out by changing permissions to "All Users".
If you're still running into this issue, @ me
I actually want to create a user doc after the user signs up. so I'm first calling account.create and then databases.createDocument. so what can be the workaround in this scenario? i need to give the update and delete permission for the new doc to the newly created user
still running into this issue @HmongDev
Try creating a session before creating the document
if i handle the whole sign-up process (both user and doc creation) in a server function, will it have full access to set the permissions for the user?
Yes, API keys can have full access provided they have an API key with the relevant scopes
Sorry, just saw this now. I'm sure @Steven can help you out.
[SOLVED] Permissions must be one of: (any, guests)
Recommended threads
- HUGE OUTRAGE IN APPWRITE, I CANNOT ACCES...
I have 2k users trying to access, sending me messages. What am I supposed to do? Please solve this asap.
- All my apps are not opening now
All my apps are not opening now 200+ apps are not opening plz fast
- Failed to generate functions SSL
```appwrite-worker-certificates | Cannot renew domain (functions.domain.com) on attempt no. 9 certificate: Failed to verify domain DNS records. appwrite-worker...