mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 01:22:50 -05:00
[SM-896] restricting access to disabled orgs (#3287)
* restricting access to disabled orgs * Unit Test Updates * Update test/Api.IntegrationTest/SecretsManager/Controllers/AccessPoliciesControllerTests.cs Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com> * Covering all test cases * making organization enabled NOT default --------- Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>
This commit is contained in:
@ -25,13 +25,22 @@ public class SecretsManagerOrganizationHelper
|
||||
_ownerEmail = ownerEmail;
|
||||
}
|
||||
|
||||
public async Task<(Organization organization, OrganizationUser owner)> Initialize(bool useSecrets, bool ownerAccessSecrets)
|
||||
public async Task<(Organization organization, OrganizationUser owner)> Initialize(bool useSecrets, bool ownerAccessSecrets, bool organizationEnabled)
|
||||
{
|
||||
(_organization, _owner) = await OrganizationTestHelpers.SignUpAsync(_factory, ownerEmail: _ownerEmail, billingEmail: _ownerEmail);
|
||||
|
||||
if (useSecrets)
|
||||
if (useSecrets || !organizationEnabled)
|
||||
{
|
||||
_organization.UseSecretsManager = true;
|
||||
if (useSecrets)
|
||||
{
|
||||
_organization.UseSecretsManager = true;
|
||||
}
|
||||
|
||||
if (!organizationEnabled)
|
||||
{
|
||||
_organization.Enabled = false;
|
||||
}
|
||||
|
||||
await _organizationRepository.ReplaceAsync(_organization);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user