Instantiate Role

I have a class (I presume this is the best way to do it) ‘Account’ which extends ‘User’.

Is it possible to instantiate every new ‘Account’ with a specified Role?

I guess what I am asking is how to get the roles from the system?

e.g.
public Account() extends User {

Role role = Role.CUSTOMER
List roles = …
roles.add(roles)
this.userRoles=roles;

Hi,

You don’t need to write any code to assign default roles to the users you create. Set value of the default role attribute to true and every new user will have such roles preset.

Regards,
Gleb