MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / update_team_member_role

Function update_team_member_role

atomic-teams/src/team_member.rs:74–90  ·  view source on GitHub ↗

Update the role of a team member. # Errors Returns [`TeamsError::MemberNotFound`](crate::error::TeamsError::MemberNotFound) if the identity is not a member of the team and [`TeamsError::PermissionDenied`](crate::error::TeamsError::PermissionDenied) if the caller lacks access.

(
    client: &StorageClient,
    org_slug: &str,
    team_slug: &str,
    identity_id: Uuid,
    role: TeamRole,
)

Source from the content-addressed store, hash-verified

72/// [`TeamsError::PermissionDenied`](crate::error::TeamsError::PermissionDenied)
73/// if the caller lacks access.
74pub async fn update_team_member_role(
75 client: &StorageClient,
76 org_slug: &str,
77 team_slug: &str,
78 identity_id: Uuid,
79 role: TeamRole,
80) -> TeamsResult<TeamMemberInfo> {
81 debug_assert_eq!(client.org_slug(), org_slug);
82 let path = format!("/teams/{team_slug}/members/{identity_id}");
83 let body = UpdateTeamMemberRoleRequest { role };
84 client.put(&path, &body).await.map_err(|e| {
85 map_remote_error(
86 e,
87 format!("team member {identity_id} in {org_slug}/{team_slug}"),
88 )
89 })
90}
91
92/// Remove an identity from a team.
93///

Callers 1

executeMethod · 0.85

Calls 2

map_remote_errorFunction · 0.85
putMethod · 0.80

Tested by

no test coverage detected