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
- dart appwrite 16.2.0 throws errors
Hi there, I just updated to 1.7.4 and also wanted to update the dart appwrite sdk to fit the appwrite version I am using now. So I updated to 16.2.0 and get th...
- Server error on multiple requests
Hi there, I've updated from 1.5.7 to 1.7.4. I am using meilisearch for indexing and have therefore a dart script which syncs the appwrite data to meilisearch in...
- server error github after upgrade to 1.8...
I got the error Error 500 Server Error general_unknown can not connect to github