* company name to Microsoft when updating the Person using the ERXKeyFilter.Delegate API
*/
public WOActionResults securityUpdateAction() {
Person person = person();
ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
filter.include(Person.COMPANY).includeAttributes(); // let you update a company inside of a person
filter.setDelegate(new ERXKeyFilter.Delegate() {
public void willTakeValueForKey(Object target, Object value, String key) throws SecurityException {
if (target instanceof Company && "name".equals(key) && value != null && ((String)value).contains("Microsoft")) {
throw new SecurityException("You can't change a Person's company name to Microsoft.");
}