Interface ITeamManagementService
Team management mutations. Authorization is enforced in the service layer by
AuthorizationTeamServiceDecorator (over ITeamService); the [RequireScope]
attributes here document the scope each operation requires.
Read operations use ITeamService directly.
public interface ITeamManagementService
Methods
AddMemberAsync(string, InviteUserModel)
[RequireScope("member:manage")]
Task AddMemberAsync(string teamKey, InviteUserModel model)
Parameters
teamKeystringmodelInviteUserModel
Returns
CreateTeamAsync(string)
Create a team. Gated by AllowTeamCreation + authentication (no scope) — self-service.
Task<ITeam> CreateTeamAsync(string name = null)
Parameters
namestring
Returns
DeleteTeamAsync(string)
Delete a team. Requires team:manage on the team (with AllowTeamCreation) or the teams:delete system scope.
[RequireScope("team:manage")]
Task DeleteTeamAsync(string teamKey)
Parameters
teamKeystring
Returns
RemoveMemberAsync(string, string)
[RequireScope("member:manage")]
Task RemoveMemberAsync(string teamKey, string userKey)
Parameters
Returns
RenameTeamAsync(string, string)
[RequireScope("team:manage")]
Task RenameTeamAsync(string teamKey, string name)
Parameters
Returns
SetInvitationResponseAsync(string, string, string, bool)
[RequireScope("team:read")]
Task SetInvitationResponseAsync(string teamKey, string userKey, string inviteCode, bool accept)
Parameters
Returns
SetMemberLastSeenAsync(string)
[RequireScope("team:read")]
Task SetMemberLastSeenAsync(string teamKey)
Parameters
teamKeystring
Returns
SetMemberNameAsync(string, string, string)
[RequireScope("member:manage")]
Task SetMemberNameAsync(string teamKey, string userKey, string name)
Parameters
Returns
SetMemberRoleAsync(string, string, AccessLevel)
[RequireScope("member:manage")]
Task SetMemberRoleAsync(string teamKey, string userKey, AccessLevel accessLevel)
Parameters
teamKeystringuserKeystringaccessLevelAccessLevel
Returns
SetMemberScopeOverridesAsync(string, string, string[])
[RequireScope("member:manage")]
Task SetMemberScopeOverridesAsync(string teamKey, string userKey, string[] scopeOverrides)
Parameters
Returns
SetMemberTenantRolesAsync(string, string, string[])
[RequireScope("member:manage")]
Task SetMemberTenantRolesAsync(string teamKey, string userKey, string[] tenantRoles)
Parameters
Returns
SetTeamCustomRolesAsync(string, IReadOnlyList<TenantRoleDefinition>)
Replace the team's runtime-defined custom roles. Requires team:manage on the team. Each
role's scopes must be app-registered scopes (rejected otherwise, as a privilege-escalation guard).
Assigning these roles to members remains a member:manage operation.
[RequireScope("team:manage")]
Task SetTeamCustomRolesAsync(string teamKey, IReadOnlyList<TenantRoleDefinition> customRoles)
Parameters
teamKeystringcustomRolesIReadOnlyList<TenantRoleDefinition>
Returns
TransferOwnershipAsync(string, string)
[RequireScope("team:manage")]
Task TransferOwnershipAsync(string teamKey, string newOwnerUserKey)