return person;
}
protected void beforeObjectCommit(Object object, Session session, ActionMapping actionMapping, ActionForm actionForm,
HttpServletRequest request, HttpServletResponse reply) throws Exception {
PersonEditorForm personForm = (PersonEditorForm)actionForm;
Person person = (Person)object;
for (int index = 0; index < personForm.getProjectCount(); index++) {
int projectId = personForm.getProjectIdAsInt(index);
if (isCurrentUserAdminOfProject(request, projectId)) {
deleteRoleAssociationsForProject(projectId, person.getId());
addRoleAssociationForProject(projectId, person.getId(), personForm.getProjectRole(index));
}
}
if (isCurrentUserAdminOfProject(request, ANY_PROJECT_ID)) {
roleAssociationRepository.deleteForPersonOnProject(SYSADMIN_ROLE_NAME, person.getId(), ANY_PROJECT_ID);
if (personForm.isSystemAdmin()) {
addRoleAssociationForProject(ANY_PROJECT_ID, person.getId(), SYSADMIN_ROLE_NAME);
}
}
authorizer.invalidateCache(person.getId());
}