diff --git a/src/angular/components/password-generator.component.ts b/src/angular/components/password-generator.component.ts index f35892d7b2..a62d308cdf 100644 --- a/src/angular/components/password-generator.component.ts +++ b/src/angular/components/password-generator.component.ts @@ -79,6 +79,24 @@ export class PasswordGeneratorComponent implements OnInit { this.showOptions = !this.showOptions; } + hasPolicyInEffect() { + if (this.enforcedPolicyOptions == null) { + return false; + } + + if (this.enforcedPolicyOptions.minLength > 0 + || this.enforcedPolicyOptions.numberCount > 0 + || this.enforcedPolicyOptions.specialCount > 0 + || this.enforcedPolicyOptions.useUppercase + || this.enforcedPolicyOptions.useLowercase + || this.enforcedPolicyOptions.useNumbers + || this.enforcedPolicyOptions.useSpecial) { + return true; + } else { + return false; + } + } + private normalizeOptions() { this.options.minLowercase = 0; this.options.minUppercase = 0;