use of cz.metacentrum.perun.audit.events.UserManagerEvents.UserUpdated in project perun by CESNET.
the class UsersManagerBlImpl method updateNameTitles.
@Override
public User updateNameTitles(PerunSession sess, User user) throws UserNotExistsException {
// Convert user to version with no empty strings in object attributes (null instead)
user = this.convertUserEmptyStringsInObjectAttributesIntoNull(user);
User beforeUpdatingUser = getPerunBl().getUsersManagerBl().getUserById(sess, user.getId());
User afterUpdatingUser = getUsersManagerImpl().updateNameTitles(sess, user);
// must audit like update user since it changes same object
if (!beforeUpdatingUser.equals(afterUpdatingUser))
getPerunBl().getAuditer().log(sess, new UserUpdated(user));
return afterUpdatingUser;
}
use of cz.metacentrum.perun.audit.events.UserManagerEvents.UserUpdated in project perun by CESNET.
the class UsersManagerBlImpl method updateUser.
@Override
public User updateUser(PerunSession sess, User user) throws UserNotExistsException {
// Convert user to version with no empty strings in object attributes (null instead)
user = this.convertUserEmptyStringsInObjectAttributesIntoNull(user);
User beforeUpdatingUser = getPerunBl().getUsersManagerBl().getUserById(sess, user.getId());
User afterUpdatingUser = getUsersManagerImpl().updateUser(sess, user);
// Log only when something is changed
if (!beforeUpdatingUser.equals(afterUpdatingUser))
getPerunBl().getAuditer().log(sess, new UserUpdated(user));
return afterUpdatingUser;
}
Aggregations