mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
SubvaultUser APIs and services
This commit is contained in:
@ -58,7 +58,7 @@ namespace Bit.Api.Controllers
|
||||
var result = await _organizationService.InviteUserAsync(new Guid(orgId), model.Email);
|
||||
}
|
||||
|
||||
[HttpPut("accept")]
|
||||
[HttpPut("{id}/accept")]
|
||||
[HttpPost("{id}/accept")]
|
||||
public async Task Accept(string orgId, string id, [FromBody]OrganizationUserAcceptRequestModel model)
|
||||
{
|
||||
@ -66,13 +66,26 @@ namespace Bit.Api.Controllers
|
||||
var result = await _organizationService.AcceptUserAsync(new Guid(id), user, model.Token);
|
||||
}
|
||||
|
||||
[HttpPost("confirm")]
|
||||
[HttpPut("{id}/confirm")]
|
||||
[HttpPost("{id}/confirm")]
|
||||
public async Task Confirm(string orgId, string id, [FromBody]OrganizationUserConfirmRequestModel model)
|
||||
{
|
||||
var result = await _organizationService.ConfirmUserAsync(new Guid(id), model.Key);
|
||||
}
|
||||
|
||||
[HttpPut("{id}")]
|
||||
[HttpPost("{id}")]
|
||||
public async Task Put(string id, [FromBody]OrganizationUserUpdateRequestModel model)
|
||||
{
|
||||
var organizationUser = await _organizationUserRepository.GetByIdAsync(new Guid(id));
|
||||
if(organizationUser == null)
|
||||
{
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
await _organizationService.SaveUserAsync(organizationUser, model.Subvaults.Select(s => s.ToSubvaultUser()));
|
||||
}
|
||||
|
||||
[HttpDelete("{id}")]
|
||||
[HttpPost("{id}/delete")]
|
||||
public async Task Delete(string orgId, string id)
|
||||
|
@ -79,6 +79,20 @@ namespace Bit.Api.Controllers
|
||||
return new SubvaultResponseModel(subvault);
|
||||
}
|
||||
|
||||
[HttpPut("user")]
|
||||
[HttpPost("user")]
|
||||
public async Task PutUserSubvaults(string orgId, [FromBody]OrganizationUserConfirmRequestModel model)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[HttpPut("{id}/users")]
|
||||
[HttpPost("{id}/users")]
|
||||
public async Task PutUsers(string orgId, string id, [FromBody]SubvaultRequestModel model)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[HttpDelete("{id}")]
|
||||
[HttpPost("{id}/delete")]
|
||||
public async Task Delete(string orgId, string id)
|
||||
|
Reference in New Issue
Block a user