def get_user_roles(user):
if user:<EOL><INDENT>groups = user.groups.all()   <EOL>roles = (RolesManager.retrieve_role(group.name) for group in groups if group.name in RolesManager.get_roles_names())<EOL>return sorted(roles, key=lambda r: r.get_name() )<EOL><DEDENT>else:<EOL><INDENT>return []<EOL><DEDENT>
Get a list of a users's roles.