
You could go with teams route. Or the function can create the document and then update it with update document locally.

If you really want to modify the limit, you would need to modify the source here: https://github.com/appwrite/appwrite/blob/887abad1904936bf9d328443598fec504c01107e/app/controllers/api/functions.php#L1027

can a user add permission to access a document for a specific team?

If they're part of the team, yes.

bec when i tried to give acces to another user it failed

then i got to know its not possible with client sdk

Thanks

A user can't grant access they don't have. But if they're in a team, they can grant that team access. And if the other user is in that team, that other user can access the document

correct me if im wrong
Step 1: create a team using Create Team
Step 2: add users to the team with user id using Create Team Membership
Step 3: update the permissions of the required document using Permission.read(Role.team(team.$id))

@Steven im getting this error
[AppwriteException: SMTP is disabled on your Appwrite instance. You can <a href="/docs/email-delivery">learn more about setting up SMTP</a> in our docs.]
on trying to add a memeber to the team

is there any way to directly add the user or it is structured in a way that an email is first sent and the user needs to accept it.. then only he can be a part of the team

Client side, emails are sent. All of this is to help prevent a user from being forced to see a document they don't want.

is it like a confirm email? where user need to click to access to the team?

It's a url to redirect the user some app of yours. Then, you need to complete the flow by calling the update team membership

i dont want to send emails and then redirect them... i guess i will be writing a custom function to add the user

@Steven im getting this error on my function
Error: Missing required parameter: "url"
at Teams.createMembership (/usr/code-start/node_modules/node-appwrite/lib/services/teams.js:240:19)
at module.exports (/usr/code-start/src/index.js:54:34)
at /usr/local/src/server.js:68:19
at processTicksAndRejections (node:internal/process/task_queues:96:5)

even though im passing the url
const membership = await teams.createMembership(
data.team.$id,
[],
"myapplink",
undefined,
data?.user.$id
);

What version of the SDK?

i fixed it... the appwrite init function created node sdk with 8.0.0

i manually updated it to 9.0.0

now its working

@Steven I have a question... When I create a document with access to a specific team... If I update the document will the permission stay the same? Or do I need to specify the permissions every time I update?

Permission will stay the same if you're only modifying the document data

and what if i want to remove a certain team from the documents permission?

Then update the permissions...
Recommended threads
- list() is very slow; eventually shows no...
When I use the web browser to view the collections in my database, the documents they contain are normally displayed within a few seconds. For a few days now, h...
- Can't start docker containers beacuse no...
Hi, I'm testing my app where I upload also files to appwrite storage. As I suspect, I've filled up my disk. Now I can't start Appwrite. Could I ask for help wit...
- Problems with adding my custom domain
