Business of Technology
We figured out teams, but the team members' roles don't appear to have an edit feature. Short of delete and add again, is this something I should add a feature request for or did I miss how to perform the task?
TL;DR
You can edit team member roles in two ways:
1. From the client side: Any team member with the `owner` role can use the `updateMembershipRoles` function to update the roles of other members. For example, you can add a `subscriber` role to a member by using the `updateMembershipRoles` function and the spread operator to keep the member's previous roles.
2. From the server side: You can also use the `updateMembershipRoles` function from a server side SDK. In this case, you don't need a member with the `owner` role as you can run it as an App user using Binyamin
You have two ways in which you'll be able to update memeber roles.
- From Client side any member that have the
owner
on that team can update any other user roles, by using theupdateMembershipRoles
function. For example:
TypeScript
const member = await teams.getMembership('[TEAM_ID]', '[MEMBERSHIP_ID]');
// Adding subscriber role.
teams.updateMembershipRoles('[TEAM_ID]', '[MEMBERSHIP_ID]', [...member.roles, 'subscriber']);
By using the spread ...
operator you're making sure you'll keep the user previous roles.
- From a Server side SDK, using the same function and syntax.
But, now you don't need any member with
owner
role, as you run it as App user using an API key.
Binyamin
Hope that's making sense.
Recommended threads
- Upgrade Issue
Am having issue upgrading my appwrite account to pro as my card number is 19 and the required input is 16 digit
- Is there way to copy project (backup/res...
I think there is betterr way of fast back up / restore specified project
- Database setup
Hi everybody, I'm new to AppWrite and I need some help designing a database. I'm trying to set up a database where: 1. There are USERS 2. A USER can create an ...