--- a/src/pyams_thesaurus/thesaurus.py Wed Mar 28 16:04:44 2018 +0200
+++ b/src/pyams_thesaurus/thesaurus.py Wed Apr 11 10:32:30 2018 +0200
@@ -17,7 +17,9 @@
import re
# import interfaces
+from pyams_form.interfaces.form import IFormContextPermissionChecker
from pyams_security.interfaces import IDefaultProtectionPolicy
+from pyams_thesaurus.interfaces import ADMIN_THESAURUS_PERMISSION
from pyams_thesaurus.interfaces.extension import IThesaurusTermExtension
from pyams_thesaurus.interfaces.loader import IThesaurusLoader
from pyams_thesaurus.interfaces.term import IThesaurusTermsContainer, IThesaurusTerm, IThesaurusLoaderTerm
@@ -270,6 +272,13 @@
manager.unregisterUtility(event.object, IThesaurus, name=event.object.name)
+@adapter_config(context=IThesaurus, provides=IFormContextPermissionChecker)
+class ThesaurusPermissionChecker(ContextAdapter):
+ """Thesaurus edit permission checker"""
+
+ edit_permission = ADMIN_THESAURUS_PERMISSION
+
+
@adapter_config(context=IThesaurus, provides=ITree)
class ThesaurusTreeAdapter(ContextAdapter):
"""Thesaurus tree adapter"""