I started with the tutorial site play-authenticate-usage. I Have play 2.1, deadbolt 2.1 and play authenticate 1.0
Unfortunately I am a JDBC guy and new to JPA and annotations.
Everything works fine, I understand how to use the @Restrict for roles. What I don't see is how to programmatically assign a user an additional role. I expected to see a function in the User class, something along the line of User.addRole( String role )
I tried the followingin class User but it didn't work (no errors, just didn't update tables)...
Change public List<? extends Role> to public List<SecurityRole>
public void addRole( String roleName )
{
SecurityRole grRole = SecurityRole.findByRoleName( Application.NEW_ROLE );
this.getRoles().add( grRole );
this.save();
this.saveManyToManyAssociations("roles");
}
thanks, Chet