docs: def set_model_permissions(context, token):
      """
      Assigns a permissions dict to the given model, much like Django
      does with its dashboard app list.
  
      Used within the change list for pages, to implement permission
      checks for the navigation tree.
      """
      model = context[token.split_contents()[1]]
      opts = model._meta
      perm_name = opts.app_label + ".%s_" + opts.object_name.lower()
      request = context["request"]
      setattr(model, "perms", {})
      for perm_type in ("add", "change", "delete"):
          model.perms[perm_type] = request.user.has_perm(perm_name % perm_type)
      return ""