Back

Document Permissions

  • 0
  • Teams
  • Databases
djcali
23 Feb, 2024, 17:39

Hello, I need some advice on how to manage some permissions on documents.

I have built an app for Party Planning. Multiple companies would use the app to manage their events. I am using one Database store store all the companies data and the reason is in this industry some employess work for multiple companies so they would pull up all the events that they are assigned to work which sometimes is for many companies.

The flow would be Companies that sign up for the app, would be a "Team", and would be assigned a 'owner' role on that team, They would be able to invite a sub contracted employee an add them to their team as a "staff" role.

The company would create events and would be added to the "Events" collection. So the events collection would have multiple companies events in it. I set the collection to use document permissions. and i can set the permissions only for that team to view. But i want the owners to be able to create and edit and the staff to be only to read.

Any suggestions on how to accomplish owners ful crud and staff only read?

Thanks!

TL;DR
To manage document permissions for different roles (owner and staff) in the Party Planning app: - Set up custom value for permissions like ```team:655bcd94447a12a81b22/owner``` - Use one Database to store all companies' data - Companies sign up as "Team" with an 'owner' role, able to invite 'staff' - Assign permissions for 'owner' to create and edit events, and 'staff' to only read - Ensure events collection permissions are set accordingly for each team This setup allows owners full CRUD access and staff read-only access to events.
djcali
23 Feb, 2024, 17:44

Would this be correct? using a custom value team:655bcd94447a12a81b22/owner

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