Updated edit permissions
authorThierry Florac <thierry.florac@onf.fr>
Thu, 21 Jun 2018 11:17:01 +0200
changeset 723 d4b00aa0a9e0
parent 722 081fcbb96f5c
child 724 2f25e871eea1
child 745 49fce7b4af50
Updated edit permissions
src/pyams_content/features/footer/zmi/__init__.py
src/pyams_content/features/header/zmi/__init__.py
--- a/src/pyams_content/features/footer/zmi/__init__.py	Thu Jun 21 08:48:45 2018 +0200
+++ b/src/pyams_content/features/footer/zmi/__init__.py	Thu Jun 21 11:17:01 2018 +0200
@@ -89,6 +89,8 @@
             fields = field.Fields(Interface)
         return fields
 
+    edit_permission = MANAGE_TEMPLATE_PERMISSION
+
     @property
     def buttons(self):
         if self.mode == INPUT_MODE:
@@ -160,12 +162,17 @@
     fields = field.Fields(IFooterSettings).select('renderer')
     weight = 1
 
+    edit_permission = MANAGE_TEMPLATE_PERMISSION
+
     _changes = None
 
     def __init__(self, context, request, group):
         context = IFooterSettings(context)
         super(FooterSettingsRendererEditSubform, self).__init__(context, request, group)
 
+    def getContent(self):
+        return IFooterSettings(self.context)
+
     def updateWidgets(self, prefix=None):
         super(FooterSettingsRendererEditSubform, self).updateWidgets(prefix)
         if 'renderer' in self.widgets:
--- a/src/pyams_content/features/header/zmi/__init__.py	Thu Jun 21 08:48:45 2018 +0200
+++ b/src/pyams_content/features/header/zmi/__init__.py	Thu Jun 21 11:17:01 2018 +0200
@@ -95,6 +95,8 @@
             fields = field.Fields(Interface)
         return fields
 
+    edit_permission = MANAGE_TEMPLATE_PERMISSION
+
     @property
     def buttons(self):
         if self.mode == INPUT_MODE:
@@ -169,12 +171,17 @@
     fields = field.Fields(IHeaderSettings).select('renderer')
     weight = 1
 
+    edit_permission = MANAGE_TEMPLATE_PERMISSION
+
     _changes = None
 
     def __init__(self, context, request, group):
         context = IHeaderSettings(context)
         super(HeaderSettingsRendererEditSubform, self).__init__(context, request, group)
 
+    def getContent(self):
+        return IHeaderSettings(self.context)
+
     def updateWidgets(self, prefix=None):
         super(HeaderSettingsRendererEditSubform, self).updateWidgets(prefix)
         if 'renderer' in self.widgets: