code: def get_user_roles(user):
      
      if not hasattr(user, '_role_cache'):
          user._role_cache = list(TenantRole.objects.filter(user=user).values_list(
              'group', 'role', 'tenant'))
      return user._role_cache
docs: Return a list of all of the user's roles.