Changed ZMI permissions
authorThierry Florac <thierry.florac@onf.fr>
Wed, 12 Jul 2017 12:09:16 +0200
changeset 5 2c525ccb478c
parent 4 96f1ba4f8fc7
child 6 fe40de633af9
Changed ZMI permissions
src/pyams_gis/zmi/layer.py
src/pyams_gis/zmi/utility.py
--- a/src/pyams_gis/zmi/layer.py	Wed Jun 21 12:14:58 2017 +0200
+++ b/src/pyams_gis/zmi/layer.py	Wed Jul 12 12:09:16 2017 +0200
@@ -25,7 +25,7 @@
 from pyams_i18n.interfaces import II18n
 from pyams_skin.interfaces.viewlet import IToolbarAddingMenu
 from pyams_skin.layer import IPyAMSLayer
-from pyams_utils.interfaces import MANAGE_SYSTEM_PERMISSION, VIEW_SYSTEM_PERMISSION
+from pyams_utils.interfaces import MANAGE_SYSTEM_PERMISSION
 from pyams_zmi.layer import IAdminLayer
 from z3c.form.interfaces import IDataExtractedEvent, DISPLAY_MODE
 from zope.component.interfaces import ISite
@@ -104,7 +104,7 @@
 
 
 @pagelet_config(name='properties.html', context=ITileMapLayer, layer=IPyAMSLayer,
-                permission=VIEW_SYSTEM_PERMISSION)
+                permission=MANAGE_SYSTEM_PERMISSION)
 class TileLayerEditForm(AdminDialogEditForm):
     """Tile layer edit form"""
 
@@ -181,7 +181,7 @@
 
 
 @pagelet_config(name='properties.html', context=IWMSMapLayer, layer=IPyAMSLayer,
-                permission=VIEW_SYSTEM_PERMISSION)
+                permission=MANAGE_SYSTEM_PERMISSION)
 class WMSLayerEditForm(AdminDialogEditForm):
     """WMS layer edit form"""
 
@@ -258,7 +258,7 @@
 
 
 @pagelet_config(name='properties.html', context=IGeoportalMapLayer, layer=IPyAMSLayer,
-                permission=VIEW_SYSTEM_PERMISSION)
+                permission=MANAGE_SYSTEM_PERMISSION)
 class GeoportalLayerEditForm(AdminDialogEditForm):
     """Geoportal layer edit form"""
 
@@ -335,7 +335,7 @@
 
 
 @pagelet_config(name='properties.html', context=IEsriFeatureMapLayer, layer=IPyAMSLayer,
-                permission=VIEW_SYSTEM_PERMISSION)
+                permission=MANAGE_SYSTEM_PERMISSION)
 class EsriFeatureLayerEditForm(AdminDialogEditForm):
     """ESRI feature layer edit form"""
 
@@ -412,7 +412,7 @@
 
 
 @pagelet_config(name='properties.html', context=IGoogleMapLayer, layer=IPyAMSLayer,
-                permission=VIEW_SYSTEM_PERMISSION)
+                permission=MANAGE_SYSTEM_PERMISSION)
 class GoogleMapLayerEditForm(AdminDialogEditForm):
     """Google Maps layer edit form"""
 
--- a/src/pyams_gis/zmi/utility.py	Wed Jun 21 12:14:58 2017 +0200
+++ b/src/pyams_gis/zmi/utility.py	Wed Jul 12 12:09:16 2017 +0200
@@ -22,7 +22,7 @@
 from pyams_skin.interfaces import IInnerPage, IPageHeader
 from pyams_skin.interfaces.container import ITableElementEditor
 from pyams_skin.layer import IPyAMSLayer
-from pyams_utils.interfaces import MANAGE_SYSTEM_PERMISSION, VIEW_SYSTEM_PERMISSION
+from pyams_utils.interfaces import MANAGE_SYSTEM_PERMISSION
 from pyams_zmi.interfaces.menu import IControlPanelMenu
 from pyams_zmi.layer import IAdminLayer
 from z3c.table.interfaces import IColumn, IValues
@@ -67,7 +67,7 @@
 
 
 @viewlet_config(name='map-manager.menu', context=ISite, layer=IAdminLayer, manager=IControlPanelMenu,
-                permission=VIEW_SYSTEM_PERMISSION, weight=6)
+                permission=MANAGE_SYSTEM_PERMISSION, weight=6)
 @viewletmanager_config(name='map-manager.menu', context=ISite, layer=IAdminLayer)
 @implementer(IMapManagerMenu)
 class MapManagerMenuItem(MenuItem):
@@ -148,7 +148,7 @@
         return ()
 
 
-@pagelet_config(name='map-manager.html', context=ISite, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
+@pagelet_config(name='map-manager.html', context=ISite, layer=IPyAMSLayer, permission=MANAGE_SYSTEM_PERMISSION)
 @implementer(IInnerPage)
 class MapManagerView(AdminView, ContainerView):
     """Map manager layers view"""
@@ -166,7 +166,7 @@
 
 
 @viewlet_config(name='map-manager.configuration.menu', context=ISite, layer=IAdminLayer,
-                manager=IMapManagerMenu, permission=VIEW_SYSTEM_PERMISSION, weight=1)
+                manager=IMapManagerMenu, permission=MANAGE_SYSTEM_PERMISSION, weight=1)
 class MapManagerConfigurationMenuItem(MenuItem):
     """Map manager properties menu"""
 
@@ -179,7 +179,7 @@
         return resource_url(manager, self.request, self.url)
 
 
-@pagelet_config(name='configuration.html', context=IMapManager, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
+@pagelet_config(name='configuration.html', context=IMapManager, layer=IPyAMSLayer, permission=MANAGE_SYSTEM_PERMISSION)
 class MapManagerConfigurationEditForm(AdminDialogEditForm):
     """Map manager edit form"""