onSync-roles.js revision d9b1fcb16f23fb4b520e5f13687b744deeebb03f
/**
* 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.
*/
/**
* If a role is sync'ed, this script will determine if users of this role needs to also
* be sync'ed. Users are always sync'ed, except if the only change is in the ignoreProperties.
*/
(function () {
/**
* If shouldSyncUsers then this will call sync on all users of the role that got sync'ed
* @param resourceName the role path.
* @param oldValue old state of the role
* @param newValue updated state of the role
* @param ignoredProperties always sync except, if there's a change and the only change is the ignoreProperties,
* then no sync is needed.
*/
var members;
// Issue triggerSyncCheck action and set fields to "*" to indicate all default fields plus any
// virtual fields on the managed user, which will pick up changes to "effectiveAssignments".
});
} else {
}
};
/**
* Returns true if the oldValue and newValue fully match, or if the only changes are in fields other than any of the
* ignoredProperties.
* @param oldValue old state of the resource
* @param newValue updated state of the resource
* @param ignoredProperties if only change is one of the ignoreProperties, then no sync is needed.
* @returns {boolean} true if the oldValue and newValue fully match, or if the only changes are in fields other than
* any of the ignoredProperties.
*/
// If they already match then we should sync.
return true;
}
// If we don't match, after removing ignored fields, then should sync as it means changes were on other fields.
}
}());