diff --git a/src/app/organizations/manage/policy-edit.component.ts b/src/app/organizations/manage/policy-edit.component.ts index 5856b3abf5c..ebf934b7168 100644 --- a/src/app/organizations/manage/policy-edit.component.ts +++ b/src/app/organizations/manage/policy-edit.component.ts @@ -175,7 +175,8 @@ export class PolicyEditComponent implements OnInit { private preValidate(): boolean { switch (this.type) { case PolicyType.RequireSso: - if (!this.enabled) { // Don't need prevalidation checks if submitting to disable + // Don't need prevalidation checks if submitting to disable + if (!this.enabled) { return true; } // Have SingleOrg policy enabled? @@ -186,6 +187,19 @@ export class PolicyEditComponent implements OnInit { } return true; + case PolicyType.SingleOrg: + // Don't need prevalidation checks if submitting to enable + if (this.enabled) { + return true; + } + // If RequireSso Policy is enabled prevent submittal + if (this.policiesEnabledMap.has(PolicyType.RequireSso) + && this.policiesEnabledMap.get(PolicyType.RequireSso)) { + this.toasterService.popAsync('error', null, this.i18nService.t('disableRequireSsoError')); + return false; + } + return true; + default: return true; } diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index 774c24d9b57..538584fadd7 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -3394,5 +3394,8 @@ }, "estimatedTax": { "message": "Estimated tax" + }, + "disableRequireSsoError": { + "message": "You must manually disable the Single Sign-On Authentication policy before this policy can be disabled." } }