1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

Initial commit of SingleOrg downstream policy checks (#1038)

This commit is contained in:
Vincent Salucci
2020-12-16 16:02:54 -06:00
committed by GitHub
parent 0f1af2333e
commit 136c39fa50
3 changed files with 29 additions and 3 deletions

View File

@ -48,6 +48,18 @@ namespace Bit.Core.Services
// Handle dependent policy checks
switch(policy.Type)
{
case PolicyType.SingleOrg:
if (!policy.Enabled)
{
var requireSso =
await _policyRepository.GetByOrganizationIdTypeAsync(org.Id, PolicyType.RequireSso);
if (requireSso?.Enabled == true)
{
throw new BadRequestException("Single Sign-On Authentication policy is enabled.");
}
}
break;
case PolicyType.RequireSso:
if (policy.Enabled)
{
@ -58,9 +70,6 @@ namespace Bit.Core.Services
}
}
break;
default:
break;
}
var now = DateTime.UtcNow;