Search in sources :

Example 1 with UserUpdated

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;
}
Also used : UserUpdated(cz.metacentrum.perun.audit.events.UserManagerEvents.UserUpdated) OwnershipRemovedForSpecificUser(cz.metacentrum.perun.audit.events.UserManagerEvents.OwnershipRemovedForSpecificUser) User(cz.metacentrum.perun.core.api.User) OwnershipEnabledForSpecificUser(cz.metacentrum.perun.audit.events.UserManagerEvents.OwnershipEnabledForSpecificUser) UserAddedToOwnersOfSpecificUser(cz.metacentrum.perun.audit.events.UserManagerEvents.UserAddedToOwnersOfSpecificUser) UserExtSourceRemovedFromUser(cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceRemovedFromUser) RichUser(cz.metacentrum.perun.core.api.RichUser) OwnershipDisabledForSpecificUser(cz.metacentrum.perun.audit.events.UserManagerEvents.OwnershipDisabledForSpecificUser) UserExtSourceAddedToUser(cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceAddedToUser) AllUserExtSourcesDeletedForUser(cz.metacentrum.perun.audit.events.UserManagerEvents.AllUserExtSourcesDeletedForUser)

Example 2 with UserUpdated

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;
}
Also used : UserUpdated(cz.metacentrum.perun.audit.events.UserManagerEvents.UserUpdated) OwnershipRemovedForSpecificUser(cz.metacentrum.perun.audit.events.UserManagerEvents.OwnershipRemovedForSpecificUser) User(cz.metacentrum.perun.core.api.User) OwnershipEnabledForSpecificUser(cz.metacentrum.perun.audit.events.UserManagerEvents.OwnershipEnabledForSpecificUser) UserAddedToOwnersOfSpecificUser(cz.metacentrum.perun.audit.events.UserManagerEvents.UserAddedToOwnersOfSpecificUser) UserExtSourceRemovedFromUser(cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceRemovedFromUser) RichUser(cz.metacentrum.perun.core.api.RichUser) OwnershipDisabledForSpecificUser(cz.metacentrum.perun.audit.events.UserManagerEvents.OwnershipDisabledForSpecificUser) UserExtSourceAddedToUser(cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceAddedToUser) AllUserExtSourcesDeletedForUser(cz.metacentrum.perun.audit.events.UserManagerEvents.AllUserExtSourcesDeletedForUser)

Aggregations

AllUserExtSourcesDeletedForUser (cz.metacentrum.perun.audit.events.UserManagerEvents.AllUserExtSourcesDeletedForUser)2 OwnershipDisabledForSpecificUser (cz.metacentrum.perun.audit.events.UserManagerEvents.OwnershipDisabledForSpecificUser)2 OwnershipEnabledForSpecificUser (cz.metacentrum.perun.audit.events.UserManagerEvents.OwnershipEnabledForSpecificUser)2 OwnershipRemovedForSpecificUser (cz.metacentrum.perun.audit.events.UserManagerEvents.OwnershipRemovedForSpecificUser)2 UserAddedToOwnersOfSpecificUser (cz.metacentrum.perun.audit.events.UserManagerEvents.UserAddedToOwnersOfSpecificUser)2 UserExtSourceAddedToUser (cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceAddedToUser)2 UserExtSourceRemovedFromUser (cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceRemovedFromUser)2 UserUpdated (cz.metacentrum.perun.audit.events.UserManagerEvents.UserUpdated)2 RichUser (cz.metacentrum.perun.core.api.RichUser)2 User (cz.metacentrum.perun.core.api.User)2