mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
check that SingleOrg policy is enabled before saying users cant create new orgs (#1110)
* check that SingleOrg policy is enabled before saying users cant create new orgs * fixed org user kick check for SingleOrg * code review cleanup
This commit is contained in:
@ -162,7 +162,7 @@ namespace Bit.Api.Controllers
|
||||
}
|
||||
|
||||
var policies = await _policyRepository.GetManyByUserIdAsync(user.Id);
|
||||
if (policies.Any(policy => policy.Type == PolicyType.SingleOrg))
|
||||
if (policies.Any(policy => policy.Enabled && policy.Type == PolicyType.SingleOrg))
|
||||
{
|
||||
throw new Exception("You may not create an organization. You belong to an organization " +
|
||||
"which has a policy that prohibits you from being a member of any other organization.");
|
||||
@ -190,7 +190,7 @@ namespace Bit.Api.Controllers
|
||||
}
|
||||
|
||||
var policies = await _policyRepository.GetManyByUserIdAsync(user.Id);
|
||||
if (policies.Any(policy => policy.Type == PolicyType.SingleOrg))
|
||||
if (policies.Any(policy => policy.Enabled && policy.Type == PolicyType.SingleOrg))
|
||||
{
|
||||
throw new Exception("You may not create an organization. You belong to an organization " +
|
||||
"which has a policy that prohibits you from being a member of any other organization.");
|
||||
|
Reference in New Issue
Block a user