
Hello, I am implementing live chat support in my app. When the user create a message, I wants the permission on that document to be user and the support agent. Is it's possible to also give read permission on the document to other user along with the author(user who created the message).

you can by using the cloud function

for instance if the chat is single chat like two members in one room. Then you can create a string array for members attribute. Store here who are the members of that room.

In that case, the list of members well be your base who can read the chats

Otherwise if there are multiple members in one room. I prefer to create another called chat_members

I am using realtime

Realtime don't support server sdks

He suggest you using server functions to handle that. Your users will still receive the data via realtime.

For example, I am listening to creation of documents in certain collection. When a user creates a message, i will trigger the function to set permissions on that message that is already created? My understanding from the above discussion is that. Can you please correct me if I am wrong.
Recommended threads
- Relationship opt-in?
Hi! I'm trying to understand opt-in relationship population. I'm listing rows as follows: `(...).listRows({ databaseId: this.databaseId, tableId: this.tableId, ...
- Appwrite messaging api error
```=== Push Notification Function Started === Endpoint: https://fra.cloud.appwrite.io/v1 Project: 6899062700398ffeae4f Database: threed-dating-db Notification f...
- ๐ Bug Report: Sign in with Apple/Google...
Environment: - Appwrite version: 1.8.0-RC2 (self-hosted) - Working version: 1.8.0 (Appwrite Cloud) - Platform: React Native - React Native version: 0.74.5 - re...
