1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05:00

org and user info

This commit is contained in:
Kyle Spearrin
2018-03-22 21:10:10 -04:00
parent 7075d8396d
commit e920c8e9d2
9 changed files with 159 additions and 55 deletions

View File

@ -14,13 +14,16 @@ namespace Bit.Admin.Controllers
public class UsersController : Controller
{
private readonly IUserRepository _userRepository;
private readonly ICipherRepository _cipherRepository;
private readonly GlobalSettings _globalSettings;
public UsersController(
IUserRepository userRepository,
ICipherRepository cipherRepository,
GlobalSettings globalSettings)
{
_userRepository = userRepository;
_cipherRepository = cipherRepository;
_globalSettings = globalSettings;
}
@ -55,10 +58,12 @@ namespace Bit.Admin.Controllers
return RedirectToAction("Index");
}
return View(new UserEditModel(user, _globalSettings));
var ciphers = await _cipherRepository.GetManyByUserIdAsync(id);
return View(new UserEditModel(user, ciphers, _globalSettings));
}
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Edit(Guid id, UserEditModel model)
{
var user = await _userRepository.GetByIdAsync(id);