1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

import groups and users for org via api

This commit is contained in:
Kyle Spearrin
2017-05-13 12:00:40 -04:00
parent 5d595d4cf9
commit 0333b47237
6 changed files with 160 additions and 4 deletions

View File

@ -131,7 +131,7 @@ namespace Bit.Api.Controllers
}
[HttpPost("import")]
public async Task PostImport([FromBody]ImportRequestModel model)
public async Task PostImport([FromBody]ImportPasswordsRequestModel model)
{
var userId = _userService.GetProperUserId(User).Value;
var folders = model.Folders.Select(f => f.ToFolder(userId)).ToList();

View File

@ -228,5 +228,17 @@ namespace Bit.Api.Controllers
await _organizationService.DeleteAsync(organization);
}
}
[HttpPost("{id}/import")]
public Task Import(string id, [FromBody]ImportOrganizationUsersRequestModel model)
{
var orgIdGuid = new Guid(id);
if(!_currentContext.OrganizationAdmin(orgIdGuid))
{
throw new NotFoundException();
}
return Task.FromResult(0);
}
}
}