Back

[SOLVED] User invited to team has access to team Permissions, but can't list team members

  • 0
  • Databases
  • Accounts
  • Web
ideclon
17 Oct, 2023, 23:27

When a user is invited to a team, they immediately (without having accepted the invite) can access resources tagged with Role.team(teamId), however teams.listMemberships(teamId) fails until they accept.

I would expect users not to have access to those resources until they accept. Is this intended behaviour?

TL;DR
User invited to team has access to team permissions but can't list team members. The issue was resolved by using the `Permission.read(Role.any())` command. The user was adding new team members using the client SDK. The user expected that invited members should not have access to resources until they accept the invitation.
Drake
18 Oct, 2023, 00:04

yes, they shouldn't have access to resources. how are you adding users?

ideclon
18 Oct, 2023, 12:44
TypeScript
teams.createMembership(
  id,
  [],
  email,
  undefined,
  undefined,
  "http://localhost:5173/accept_team_invitation",
);
Drake
18 Oct, 2023, 12:45

This is using a client SDK?

ideclon
18 Oct, 2023, 12:45

Yep, from Web

ideclon
18 Oct, 2023, 12:49

Oh, wait, I'm an idiot - Permission.read(Role.any())

ideclon
18 Oct, 2023, 12:50

[SOLVED] User invited to team has access to team Permissions, but can't list team members

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