Back

[CLOSED] Create room with 2 userid read permission: Permissions must be one of: (any, users…)

  • 0
  • Databases
  • Web
xue
3 Oct, 2023, 00:09

Hello everyone,

I am trying to create room document with permissions. As i understand i cannot authorized to give to any permissions for any other user due to response.

First idea coming to my mind is : Should i create a team for every private room with 2 users ?

How can i handle with this situation ?

Why i am doing this : Because i want to be get notified another user by listening realtime and see that room as well.

TypeScript
  createRoom(data: any): Promise<any> {
    console.log(data);
    return this.api.createDocument(
      environment.appwrite.ROOMS_COLLECTION,
      ID.unique(),
      data,
      [
        Permission.read(Role.user(data.users[0])),
        Permission.read(Role.user(data.users[1])),
      ]
    );
  }

Response :

TL;DR
The user is trying to create a room document with permissions for two users. However, they are getting a response saying that permissions must be one of: any, users. They have created a bug issue for this and are using the Appwrite version 1.4.x. They are wondering if it is possible to create a team and add membership for another user on the client side. They would like to be notified in real-time and have the other user see the room as well. Solution: The user can use a team or an Appwrite function to handle this situation. It is suggested to create a team for every private room with
Drake
3 Oct, 2023, 04:17

Yes, you can use a team or an appwrite function

xue
3 Oct, 2023, 10:33

[SOLVED] Create room with 2 userid read permission: Permissions must be one of: (any, users…)

xue
6 Oct, 2023, 22:58

Create room with 2 userid read permission: Permissions must be one of: (any, users…)

xue
6 Oct, 2023, 23:14

I can create a team by client side but and cannot add a membership for different user.

I want to create a team when createRoom function called, then create membership with these 2 members. Is it possible to createMembership for another user in client side ?

Drake
6 Oct, 2023, 23:24

Client-side, only the owner of a team is allowed to invite users to the team

xue
7 Oct, 2023, 09:02

Im sorry but i cant add/invite any users in appwrite version of 1.4.x Created a bug issue about it: https://github.com/appwrite/appwrite/issues/6839

Drake
7 Oct, 2023, 14:37

Would you please include the SDK and version you're using?

xue
7 Oct, 2023, 14:47

edited in the issue entry! Best

xue
7 Oct, 2023, 14:49

[CLOSED] Create room with 2 userid read permission: Permissions must be one of: (any, users…)

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