docs: def _get_permission_set_tree(user):
      """
      Helper to return cached permission set tree from user instance if set, else
      generates and returns analyzed permission set tree. Does not cache set
      automatically, that must be done explicitely.
      """
      if hasattr(user, CACHED_PSET_PROPERTY_KEY):
          return getattr(user, CACHED_PSET_PROPERTY_KEY)
      if user.is_authenticated():
          try:
              return user.permissionset.first().tree()
          except AttributeError:
              raise ObjectDoesNotExist
      return PermissionSet.objects.get(anonymous_user=True).tree()