Updated container element delete helper
authorThierry Florac <thierry.florac@onf.fr>
Wed, 11 Apr 2018 12:12:30 +0200
changeset 41 d42af9cfbd97
parent 40 bc5b1fece177
child 42 ae7c20db2df2
Updated container element delete helper
src/pyams_catalog/zmi/catalog.py
--- a/src/pyams_catalog/zmi/catalog.py	Tue Apr 10 16:22:40 2018 +0200
+++ b/src/pyams_catalog/zmi/catalog.py	Wed Apr 11 12:12:30 2018 +0200
@@ -202,6 +202,13 @@
         return super(CatalogIndexTrashColumn, self).has_permission(self.context)
 
 
+@view_config(name='delete-element.json', context=ICatalog, request_type=IPyAMSLayer,
+             permission=MANAGE_SYSTEM_PERMISSION, renderer='json', xhr=True)
+def delete_catalog_index(request):
+    """Delete index from catalog"""
+    return delete_container_element(request, ignore_permission=True)
+
+
 @adapter_config(context=(ICatalog, IAdminLayer, CatalogIndexesTable), provides=IValues)
 class CatalogIndexesValuesAdapter(ContextRequestViewAdapter):
     """Catalog indexes values adapter"""
@@ -217,10 +224,3 @@
     """Catalog indexes viewlet"""
 
     table_class = CatalogIndexesTable
-
-
-@view_config(name='delete-element.json', context=ICatalog, request_type=IPyAMSLayer,
-             permission=MANAGE_SYSTEM_PERMISSION, renderer='json', xhr=True)
-def delete_catalog_index(request):
-    """Delete index from catalog"""
-    return delete_container_element(request)