I created a user this way
User user = dataManager.create(User.class);
user.setCf(codiceFiscale);
user.setUsername(codiceFiscale);
user.setPassword(codiceFiscale);
user.setFirstName((String) VaadinSession.getCurrent().getAttribute(""));
user.setLastName((String) VaadinSession.getCurrent().getAttribute(""));
saveContext.saving(user);
I want to assign it a role by writing some code.
I tried with this but it throws an exception
RoleAssignment roleAssignment = new RoleAssignment(user.getUsername(), “ditta”, “resource”);
What can I do?