Removed references settings from search folder
authorThierry Florac <thierry.florac@onf.fr>
Mon, 14 Jan 2019 16:19:42 +0100
changeset 1231 20fbc5f350d1
parent 1230 4424718fb9e8
child 1232 d61066e2bb63
Removed references settings from search folder
src/pyams_content/features/search/zmi/reference.py
--- a/src/pyams_content/features/search/zmi/reference.py	Sun Jan 13 10:13:38 2019 +0100
+++ b/src/pyams_content/features/search/zmi/reference.py	Mon Jan 14 16:19:42 2019 +0100
@@ -13,19 +13,23 @@
 __docformat__ = 'restructuredtext'
 
 from pyams_content.features.search import ISearchFolder
-from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION
-from pyams_content.shared.view.zmi.reference import ViewReferencesEditForm
 from pyams_form.form import ajax_config
 from pyams_pagelet.pagelet import pagelet_config
 from pyams_skin.layer import IPyAMSLayer
-from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION
-
-from pyams_content import _
+from pyams_utils.adapter import NullAdapter
+from pyams_utils.interfaces import FORBIDDEN_PERMISSION, VIEW_SYSTEM_PERMISSION
+from pyams_viewlet.viewlet import viewlet_config
+from pyams_zmi.interfaces.menu import IPropertiesMenu
+from pyams_zmi.layer import IAdminLayer
 
 
-@pagelet_config(name='references.html', context=ISearchFolder, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
-@ajax_config(name='references.json', context=ISearchFolder, layer=IPyAMSLayer, permission=MANAGE_CONTENT_PERMISSION)
-class SearchFolderReferencesEditForm(ViewReferencesEditForm):
-    """View search folder references settings edit form"""
+@viewlet_config(name='references.menu', context=ISearchFolder, layer=IAdminLayer,
+                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=290)
+class SearchFolderReferencesMenu(NullAdapter):
+    """Disabled search folder references menu"""
 
-    legend = _("Search folder internal references settings")
+
+@pagelet_config(name='references.html', context=ISearchFolder, layer=IPyAMSLayer, permission=FORBIDDEN_PERMISSION)
+@ajax_config(name='references.json', context=ISearchFolder, layer=IPyAMSLayer, permission=FORBIDDEN_PERMISSION)
+class SearchFolderReferencesEditForm(NullAdapter):
+    """Disabled search folder references settings edit form"""