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

This commit is contained in:
Oscar Hinton 2021-10-14 09:01:23 +02:00 committed by GitHub
parent 4b4b5910e3
commit c3a910e785
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 5 deletions

View File

@ -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);

View File

@ -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."