def get_user_roles(self, user=None):
if user is None:<EOL><INDENT>user = g.user<EOL><DEDENT>if user.is_anonymous:<EOL><INDENT>public_role = appbuilder.config.get('<STR_LIT>')<EOL>return [appbuilder.security_manager.find_role(public_role)]if public_role else []<EOL><DEDENT>return user.roles<EOL>
Get all the roles associated with the user.

:param user: the ab_user in FAB model.
:return: a list of roles associated with the user.