You could go with teams route. Or the function can create the document and then update it with update document locally.
How to Increase the function data length from 8192
Votes
0
Replies
24
Participants
Unknown
Messages
25
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
Rank 4: Virtual Machine
can a user add permission to access a document for a specific team?
If they're part of the team, yes.
Rank 4: Virtual Machine
bec when i tried to give acces to another user it failed
Rank 4: Virtual Machine
then i got to know its not possible with client sdk
Rank 4: Virtual Machine
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
Rank 4: Virtual Machine
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))
Rank 4: Virtual Machine
@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
Rank 4: Virtual Machine
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.
Rank 4: Virtual Machine
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
Rank 4: Virtual Machine
i dont want to send emails and then redirect them... i guess i will be writing a custom function to add the user
Rank 4: Virtual Machine
@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)
Rank 4: Virtual Machine
even though im passing the url
const membership = await teams.createMembership(
data.team.$id,
[],
"myapplink",
undefined,
data?.user.$id
);
What version of the SDK?
Rank 4: Virtual Machine
i fixed it... the appwrite init function created node sdk with 8.0.0
Rank 4: Virtual Machine
i manually updated it to 9.0.0
Rank 4: Virtual Machine
now its working
Rank 4: Virtual Machine
@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
Rank 4: Virtual Machine
and what if i want to remove a certain team from the documents permission?
Then update the permissions...