pwpolicy.js revision 4f4573637d598fab1818164e79e51a079494b33f
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015 ForgeRock AS.
*/
/*global addPolicy, request, openidm */
"policyId" : "is-new",
"policyExec" : "isNew",
"policyRequirements" : ["IS_NEW"]
});
// Don't enforce this policy if the resource ends with "/*", which indicates that this is a create with a
// server-supplied id
return [];
}
// Read the resource
// Don't enforce this policy if the resource being evaluated wasn't found. Happens in the case of a create with a
// client-supplied id.
if (currentObject === null) {
return [];
}
// Decrypt the "fieldHistory" field.
// Don't enforce this policy if there is no history object available
return [];
}
// Get the current field value
}
// Don't enforce this policy if the password hasn't changed
return [];
}
// Get the last field values
} else {
}
// Check if the current value matches any previous values
|| (lastFieldValues[i] === value)) {
return [{"policyRequirement": "IS_NEW"}];
}
}
return [];
}