Get IPortalPage as content in inherited template properties edit form
authorThierry Florac <thierry.florac@onf.fr>
Thu, 21 Jun 2018 10:38:57 +0200
changeset 129 481310ae09ad
parent 128 453ca794dc01
child 130 26038059e74d
Get IPortalPage as content in inherited template properties edit form
src/pyams_portal/zmi/page.py
--- a/src/pyams_portal/zmi/page.py	Wed Jun 20 18:13:55 2018 +0200
+++ b/src/pyams_portal/zmi/page.py	Thu Jun 21 10:38:57 2018 +0200
@@ -86,6 +86,11 @@
     fields = field.Fields(IPortalPage).select('use_shared_template', 'shared_template')
     fields['use_shared_template'].widgetFactory = SingleCheckBoxFieldWidget
 
+    edit_permission = MANAGE_TEMPLATE_PERMISSION
+
+    def getContent(self):
+        return IPortalPage(self.context)
+
     def updateGroups(self):
         self.add_group(NamedWidgetsGroup(self, 'inherited_template_properties', self.widgets,
                                          ('use_shared_template', 'shared_template',),