001package com.identityworksllc.iiq.common.password;
002
003import sailpoint.api.passwordConstraints.AbstractPasswordConstraint;
004
005/**
006 * An abstract class for extended password constraints, which mainly exists to provide
007 * a default for the {@link #generate()} method and the admin flag functionality.
008 */
009public abstract class AbstractExtendedPasswordConstraint extends AbstractPasswordConstraint implements ExtendedPasswordConstraint {
010
011    /**
012     * Indicates whether the current check is being done by an admin.
013     * If true, the constraint may be skipped.
014     */
015    protected boolean isAdmin = false;
016
017    /**
018     * Sets the admin flag for this constraint.
019     * @param isAdmin true if the current check is being done by an admin, false otherwise.
020     */
021    @Override
022    public void setAdmin(boolean isAdmin) {
023        this.isAdmin = isAdmin;
024    }
025}