code: def get_user_roles(self, user):
          
  
          # For SQL: user.roles is list of pointers to Role objects
          if isinstance(self.db_adapter, SQLDbAdapter):
              # user.roles is a list of Role IDs
              user_roles = [role.name for role in user.roles]
  
  
          # For others: user.roles is a list of role names
          else:
              # user.roles is a list of role names
              user_roles = user.roles
  
          return user_roles
docs: Retrieve a list of user role names.
  
          .. note::
  
              Database management methods.