use of io.openems.api.security.User in project openems by OpenEMS.
the class OpenemsEnroler method enrole.
@Override
public void enrole(ClientInfo clientInfo) {
String username = clientInfo.getUser().getIdentifier();
User user;
try {
user = User.getUserByName(username);
//
clientInfo.getRoles().add(//
Role.get(Application.getCurrent(), user.getRole().name().toLowerCase()));
} catch (OpenemsException e) {
/* ignore, just don't enrole user in any group */
}
}
Aggregations