mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00
remove user from group apis
This commit is contained in:
@ -123,5 +123,18 @@ namespace Bit.Api.Controllers
|
||||
|
||||
await _groupRepository.DeleteAsync(group);
|
||||
}
|
||||
|
||||
[HttpDelete("{id}/user/{orgUserId}")]
|
||||
[HttpPost("{id}/delete-user/{orgUserId}")]
|
||||
public async Task Delete(string orgId, string id, string orgUserId)
|
||||
{
|
||||
var group = await _groupRepository.GetByIdAsync(new Guid(id));
|
||||
if(group == null || !_currentContext.OrganizationAdmin(group.OrganizationId))
|
||||
{
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
await _groupRepository.DeleteUserAsync(group.Id, new Guid(orgUserId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user