diff sat/plugins/plugin_misc_lists.py @ 3471:d897597cfa94

plugin list: set `overwrite_policy` to `any_publisher` for `grocery` list
author Goffi <goffi@goffi.org>
date Sat, 27 Feb 2021 18:33:53 +0100
parents ca76767185e3
children e12e9e1535d3
line wrap: on
line diff
--- a/sat/plugins/plugin_misc_lists.py	Sat Feb 27 18:32:34 2021 +0100
+++ b/sat/plugins/plugin_misc_lists.py	Sat Feb 27 18:33:53 2021 +0100
@@ -492,8 +492,12 @@
         service = client.jid.userhostJID()
         node = self._s.getSubmittedNS(f"{APP_NS_TICKETS}_{name}")
         options = {
-            self._p.OPT_ACCESS_MODEL: access_model
+            self._p.OPT_ACCESS_MODEL: access_model,
         }
+        if template_id == "grocery":
+            # for grocery list, we want all publishers to be able to set all items
+            # XXX: should node options be in TEMPLATE?
+            options[self._p.OPT_OVERWRITE_POLICY] = self._p.OWPOL_ANY_PUB
         await self._p.createNode(client, service, node, options)
         await self._s.setSchema(client, service, node, schema)
         list_elt = domish.Element((APP_NS_TICKETS, "list"))