
I am using appwrite.cloud.io
i have created a document... and now I want to give other users access to that document. The selectedItems
prop is a list of users that I want to give access to the document.
Thanks
await appwrite.databases.updateDocument(
import.meta.env.VITE_APPWRITE_DB,
import.meta.env.VITE_COLLECTION,
routeParams.id as string,
{
members: currentMembers.concat(selectedItems.map((i) => i.$id)),
},
selectedItems.map((i) => Permission.read(Role.user(i.$id)))
);
is there something I am missing or can this not be done

How do I Update the permissions of a document, that I created In the Cloud?

If a user wants to share access to a document, they must create a team, grant that team access, and then invite users to the team. This is to help prevent a user from forcing another user to access something they don't want.
Otherwise, you can use a server SDK to force a user into a team

the problem is that you are limited to 10 team requests an hour, also this is for a mobile app so then we introduce the additional lift of dealing with deep-linking to get the member accepted to the team

the bigger issue is the 10 person limit in an hour

i think there probably are better way to prevent the abuse, if i have created an app and you sign up and i use your userid to add you to a team i dont see that as being abusive

but... it is what it is, how do I force a user on a team using the server API... do I just make the same call but from the server?

Exactly, same call

So there is no ability to change permissions on a document after it is created? Or you can only change permission on a document if the permission is based on the owner of the document? It is not clear in the documentation what can be updated in the permissions

Yes, permissions can be updated, but a user cannot assign a permission they don't have. user:another_users_id
is a permission the user doesn't have

Can the node.js api assign permissions?

With an API key that has the scope

Server SDK with API key bypasses the restrictions

I will try the cloud function route
Recommended threads
- [Node.js SDK] Bypass 2GB file limit?
Hello. Using either InputFile.fromPath or InputFile.fromBuffer throws this error: File size (2295467305) is greater than 2 GiB Bucket limit etc. is setup corre...
- Relationship null, even when relationshi...
Hi Everyone, im experiencing issues with set relation data. When im setting the document id from the related database most of them seem fine, except one table. ...
- Website shows just the HTML in safari
Hi y'all, I've been working on a project for a while but, for some reason it just shows the html in safari, It work perfectly fine in firefox and chrome, but sa...
