Back

How to Increase the function data length from 8192

  • 0
  • Self Hosted
Drake
29 Jul, 2023, 18:49

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

TL;DR
The user wants to increase the function data length from 8192. They also have questions about document permissions and updating them. The solution is to modify the source code to change the limit or use the teams route to manage document permissions.
Drake
29 Jul, 2023, 18:50

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

rohan
29 Jul, 2023, 18:50

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

Drake
29 Jul, 2023, 18:51

If they're part of the team, yes.

rohan
29 Jul, 2023, 18:51

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

rohan
29 Jul, 2023, 18:51

then i got to know its not possible with client sdk

rohan
29 Jul, 2023, 18:52

Thanks

Drake
29 Jul, 2023, 18:53

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

rohan
29 Jul, 2023, 19:00

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))

rohan
29 Jul, 2023, 20:02

@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

rohan
29 Jul, 2023, 20:03

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

Drake
29 Jul, 2023, 20:25

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.

rohan
29 Jul, 2023, 20:27

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

Drake
29 Jul, 2023, 20:27

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

rohan
29 Jul, 2023, 20:31

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

rohan
29 Jul, 2023, 21:18

@Steven im getting this error on my function

TypeScript
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)
rohan
29 Jul, 2023, 21:19

even though im passing the url

TypeScript
const membership = await teams.createMembership(
    data.team.$id,
    [],
    "myapplink",
    undefined,
    data?.user.$id
  );
Drake
29 Jul, 2023, 21:23

What version of the SDK?

rohan
29 Jul, 2023, 21:23

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

rohan
29 Jul, 2023, 21:23

i manually updated it to 9.0.0

rohan
29 Jul, 2023, 21:23

now its working

rohan
30 Jul, 2023, 08:58

@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?

Drake
30 Jul, 2023, 16:24

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

rohan
30 Jul, 2023, 16:26

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

Drake
30 Jul, 2023, 17:17

Then update the permissions...

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more