com.netgrif.application.engine.event.events.user.UserRoleChangeEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of application-engine Show documentation
Show all versions of application-engine Show documentation
System provides workflow management functions including user, role and data management.
package com.netgrif.application.engine.event.events.user;
import com.netgrif.application.engine.auth.domain.IUser;
import com.netgrif.application.engine.auth.domain.LoggedUser;
import com.netgrif.application.engine.petrinet.domain.roles.ProcessRole;
import lombok.Getter;
import java.util.Collection;
public class UserRoleChangeEvent extends UserEvent {
@Getter
protected final Collection roles;
public UserRoleChangeEvent(LoggedUser user, Collection roles) {
super(user);
this.roles = roles;
}
public UserRoleChangeEvent(IUser user, Collection roles) {
super(user.transformToLoggedUser());
this.roles = roles;
}
@Override
public String getMessage() {
StringBuilder sb = new StringBuilder("Roles ");
roles.forEach(role -> {
sb.append(role.getName());
sb.append(",");
});
sb.append(" assigned to user ");
sb.append(user.getUsername());
return sb.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy