src/pyams_thesaurus/zmi/manager.py
changeset 19 6cb6acc05cc3
parent 8 2064d2a24a70
child 35 561b0ce57281
--- a/src/pyams_thesaurus/zmi/manager.py	Thu Oct 08 11:41:02 2015 +0200
+++ b/src/pyams_thesaurus/zmi/manager.py	Thu Oct 08 12:15:52 2015 +0200
@@ -9,26 +9,6 @@
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
 #
-from z3c.table.interfaces import IColumn, IValues
-from zope.component.interfaces import ISite
-from pyams_pagelet.pagelet import pagelet_config
-from pyams_skin.container import ContainerView
-from pyams_skin.interfaces import IInnerPage, IPageHeader
-from pyams_skin.interfaces.viewlet import IWidgetTitleViewletManager
-from pyams_skin.layer import IPyAMSLayer
-from pyams_skin.page import DefaultPageHeaderAdapter
-from pyams_skin.table import BaseTable, TrashColumn
-from pyams_skin.viewlet.menu import MenuItem
-from pyams_skin.viewlet.toolbar import ToolbarAction
-from pyams_thesaurus.interfaces.thesaurus import IThesaurus
-from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter
-from pyams_utils.registry import get_utilities_for
-from pyams_utils.url import absolute_url
-from pyams_viewlet.manager import viewletmanager_config
-from pyams_viewlet.viewlet import viewlet_config
-from pyams_zmi.interfaces.menu import IControlPanelMenu
-from pyams_zmi.layer import IAdminLayer
-from pyams_zmi.view import AdminView
 
 __docformat__ = 'restructuredtext'
 
@@ -36,15 +16,36 @@
 # import standard library
 
 # import interfaces
+from pyams_skin.interfaces import IInnerPage, IPageHeader
+from pyams_skin.interfaces.viewlet import IWidgetTitleViewletManager
+from pyams_skin.layer import IPyAMSLayer
+from pyams_thesaurus.interfaces.thesaurus import IThesaurus
+from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION, MANAGE_SYSTEM_PERMISSION
+from pyams_zmi.interfaces.menu import IControlPanelMenu
+from pyams_zmi.layer import IAdminLayer
+from zope.component.interfaces import ISite
+from z3c.table.interfaces import IColumn, IValues
 
 # import packages
+from pyams_pagelet.pagelet import pagelet_config
+from pyams_skin.container import ContainerView
+from pyams_skin.page import DefaultPageHeaderAdapter
+from pyams_skin.table import BaseTable, TrashColumn
+from pyams_skin.viewlet.menu import MenuItem
+from pyams_skin.viewlet.toolbar import ToolbarAction
+from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter
+from pyams_utils.registry import get_utilities_for
+from pyams_utils.url import absolute_url
+from pyams_viewlet.manager import viewletmanager_config
+from pyams_viewlet.viewlet import viewlet_config
+from pyams_zmi.view import AdminView
 from zope.interface import implementer, Interface
 
 from pyams_thesaurus import _
 
 
 @viewlet_config(name='thesaurus.menu', context=ISite, layer=IAdminLayer, manager=IControlPanelMenu,
-                permission='system.view', weight=15)
+                permission=VIEW_SYSTEM_PERMISSION, weight=15)
 @viewletmanager_config(name='thesaurus.menu', context=ISite, layer=IAdminLayer)
 class ThesaurusMenuItem(MenuItem):
     """Thesaurus menu item"""
@@ -76,7 +77,7 @@
     """Thesaurus trash column"""
 
     icon_hint = _("Delete thesaurus")
-    permission = 'system.manage'
+    permission = MANAGE_SYSTEM_PERMISSION
 
 
 @adapter_config(context=(ISite, IAdminLayer, ControlPanelThesaurusTable), provides=IValues)
@@ -89,7 +90,7 @@
             yield thesaurus
 
 
-@pagelet_config(name='thesaurus.html', context=ISite, layer=IPyAMSLayer, permission='system.view')
+@pagelet_config(name='thesaurus.html', context=ISite, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
 @implementer(IInnerPage)
 class ControlPanelThesaurusView(AdminView, ContainerView):
     """Control panel thesaurus view"""
@@ -107,7 +108,7 @@
 
 
 @viewlet_config(name='add-thesaurus.action', context=ISite, view=ControlPanelThesaurusTable, layer=IAdminLayer,
-                manager=IWidgetTitleViewletManager, permission='system.manage')
+                manager=IWidgetTitleViewletManager, permission=MANAGE_SYSTEM_PERMISSION)
 class ThesaurusAddAction(ToolbarAction):
     """Thesaurus add action"""