Skip to content
Back

[SOLVED] How to list roles in a team?

  • 0
  • Teams
  • Flutter
  • Web
  • Apple
  • Self Hosted
D5
7 May, 2023, 17:09

As said, you can put that into a database and then get the data from it (you update the database at the same time as roles)

TL;DR
The user was looking for a way to list roles in a team and suggested that it would be helpful to have all roles visible for a team. The solution provided was to list memberships on a team and look at the roles for each member. The user was also informed that they can open a feature request on GitHub to suggest being able to get a user's role.
D5
7 May, 2023, 17:09

You can open a feature request on GitHub issues to suggest being able to get user's role

Nimit Savant
7 May, 2023, 17:13

Thanks. I think I understood. Sure would open one after more thought into this.

Drake
7 May, 2023, 17:31

There is an owner role

Drake
7 May, 2023, 17:32

You can list memberships on a team and look at the roles for each member: https://appwrite.io/docs/client/teams?sdk=web-default#teamsListMemberships

Nimit Savant
7 May, 2023, 17:33

But like in the team dashboard, is there a tag that we offer that he is the owner

Drake
7 May, 2023, 17:34

It's in the roles of the team membership

D5
7 May, 2023, 17:38

If you create a team, you get by default the owner role, since you created it, unless something else is specified

Nimit Savant
7 May, 2023, 17:38

We're creating teams on behalf of someone on from the appwrite dashboard directly and not using SDK or rest. Because we're trying to make a multi tenant system and then according to the team roles the users would be able to access that data.

Nimit Savant
7 May, 2023, 17:39

But we can create an empty team without any users then who'd be the owner?

Nimit Savant
7 May, 2023, 17:39

Or maybe I'm using the teams feature in a wrong way

D5
7 May, 2023, 17:39

Nobody

D5
7 May, 2023, 17:40

You're using it in the wrong way

Nimit Savant
7 May, 2023, 17:40

Hmm

Nimit Savant
7 May, 2023, 17:40

I think that clears up my doubt a lot.

D5
7 May, 2023, 17:42

Teams is basically for permissions, if you want to create a "page" or anything else without permissions, then create a database collection, and each page will be a document. Inside the document, you can save all the corresponding data respect to the page. Also if you need specific users to manage the page, you could assign it directly or a team to the page. In other words, basically teams is mainly for permissions (although it can be used too for the first case)

Nimit Savant
7 May, 2023, 17:42

I still think there should be a function directly to call all the roles in the sdk. Reason being: we've an option of updating collection/document security with Role:[team][role]

Drake
7 May, 2023, 17:42

Teams are used to grant access to multiple people. It's like groups

Nimit Savant
7 May, 2023, 17:43

If we've this granular control for team->role We should also register Roles of a team

Drake
7 May, 2023, 17:44

Can you give more concrete examples of what kind of access you need?

Nimit Savant
7 May, 2023, 17:45

Sure, I'll drop an example in some time

Nimit Savant
7 May, 2023, 21:05

I think I got a way around using it. But I still think it would be a great great addition to make all roles visible for a team. The reason being, we're telling people to update permissions according to these role in a team. If the roles are not even registered by Appwrite it drops the values of these roles. I think the it would sound more granular at this point but this is just my opinion.

Nimit Savant
7 May, 2023, 21:05

@Steven @D5 you can close this issue and marked as resolved.

D5
7 May, 2023, 21:20

Ok

D5
7 May, 2023, 21:20

[SOLVED] How to list roles in a team?

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