Back

Web SDK: what the best way to retrieve the current users roles on a given team?

  • 0
  • Auth
  • Web
  • Cloud
devo_wm
21 May, 2024, 13:58

Looks like I'll need to make 3 queries.

one to retrieve my current users teams ids teams.list(). another to retrieve the current users membership id teams.listMemberships($teamId) and yet another to retreive the roles teams.getMembership($teamId, $membershipId)

Wondering if there was any way to retreive the membership id and roles on the initial teams.list()?

TL;DR
Best way to retrieve current user's roles on a given team using Web SDK: - Initial query for user's team IDs `teams.list()` - Second query: current user's membership ID `teams.listMemberships($teamId)` - Third query: roles by `teams.getMembership($teamId, $membershipId)` No direct way to retrieve membership ID and roles on the initial `teams.list()`.
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