1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-22 02:51:33 +01:00

use policy service

This commit is contained in:
Kyle Spearrin 2020-01-15 09:19:49 -05:00
parent 937bb4359f
commit df4abea345

View File

@ -16,13 +16,16 @@ namespace Bit.Api.Controllers
public class PoliciesController : Controller
{
private readonly IPolicyRepository _policyRepository;
private readonly IPolicyService _policyService;
private readonly CurrentContext _currentContext;
public PoliciesController(
IPolicyRepository policyRepository,
IPolicyService policyService,
CurrentContext currentContext)
{
_policyRepository = policyRepository;
_policyService = policyService;
_currentContext = currentContext;
}
@ -62,7 +65,7 @@ namespace Bit.Api.Controllers
}
var policy = model.ToPolicy(orgIdGuid);
//await _groupService.SaveAsync(group, model.Collections?.Select(c => c.ToSelectionReadOnly()));
await _policyService.SaveAsync(policy);
return new PolicyResponseModel(policy);
}
@ -76,7 +79,7 @@ namespace Bit.Api.Controllers
throw new NotFoundException();
}
//await _groupService.SaveAsync(model.ToPolicy(policy));
await _policyService.SaveAsync(model.ToPolicy(policy));
return new PolicyResponseModel(policy);
}
@ -90,7 +93,7 @@ namespace Bit.Api.Controllers
throw new NotFoundException();
}
//await _groupService.DeleteAsync(policy);
await _policyService.DeleteAsync(policy);
}
}
}