Back

how to permit many users for a document using their emails

  • 0
  • Databases
  • Web
  • Users
manazo
10 Jun, 2023, 10:18

as the title suggests, I'm trying to give permission to a doc to many users while creating the document. I only have their emails. And to be clear, there can be emails whose accounts aren't created yet. But will be created. the documentation says, to give permissions to docs, the syntax is Permission.read(Role.user(<USER_ID>)). Here I only can pass one string in the user method. but I need to give permission to many users. yeah I know I can loop over my emails list and create a permissions array and pass that in the createDocument function. but won't that be good if we could pass a user's array directly? like Permission.read(Role.user([<USER_ID>])) And second, the major problem is about the USER_ID. can I do it with emails? or any workaround for this?

Not sure if I made it enough clear. Any help will be appreciated

TL;DR
The user is asking how to give permission to multiple users for a document using their emails. The solution is to create an array of permissions and use the IDs instead of the emails. The user suggests creating a user array directly instead of looping over the emails list. The user also asks if it's possible to use emails instead of user IDs and if there are any workarounds.
Drake
10 Jun, 2023, 15:46

You can't put an email; you'll need to create the accounts and use the IDs.

You'll need to create an array of 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