Browse Source

Prevent disabling single org when max vault timeout policy is enabled (#1230)

(cherry picked from commit c3a910e785)
pull/1238/head
Oscar Hinton 4 years ago committed by Hinton
parent
commit
5dccf54611
  1. 11
      src/app/organizations/policies/single-org.component.ts
  2. 10
      src/locales/en/messages.json

11
src/app/organizations/policies/single-org.component.ts

@ -26,9 +26,14 @@ export class SingleOrgPolicyComponent extends BasePolicyComponent { @@ -26,9 +26,14 @@ export class SingleOrgPolicyComponent extends BasePolicyComponent {
}
buildRequest(policiesEnabledMap: Map<PolicyType, boolean>): Promise<PolicyRequest> {
const requireSsoEnabled = policiesEnabledMap.get(PolicyType.RequireSso) ?? false;
if (!this.enabled.value && requireSsoEnabled) {
throw new Error(this.i18nService.t('disableRequireSsoError'));
if (!this.enabled.value) {
if (policiesEnabledMap.get(PolicyType.RequireSso) ?? false) {
throw new Error(this.i18nService.t('disableRequiredError', this.i18nService.t('requireSso')));
}
if (policiesEnabledMap.get(PolicyType.MaximumVaultTimeout) ?? false) {
throw new Error(this.i18nService.t('disableRequiredError', this.i18nService.t('maximumVaultTimeoutLabel')));
}
}
return super.buildRequest(policiesEnabledMap);

10
src/locales/en/messages.json

@ -3853,8 +3853,14 @@ @@ -3853,8 +3853,14 @@
"manageResetPassword": {
"message": "Manage Password Reset"
},
"disableRequireSsoError": {
"message": "You must manually disable the Single Sign-On Authentication policy before this policy can be disabled."
"disableRequiredError": {
"message": "You must manually disable the $POLICYNAME$ policy before this policy can be disabled.",
"placeholders": {
"policyName": {
"content": "$1",
"example": "Single Sign-On Authentication"
}
}
},
"personalOwnershipPolicyInEffect": {
"message": "An organization policy is affecting your ownership options."

Loading…
Cancel
Save