diff -r a5b80a5c43de -r a89ab799a162 src/pyams_content/features/footer/__init__.py --- a/src/pyams_content/features/footer/__init__.py Fri Jul 26 13:02:34 2019 +0200 +++ b/src/pyams_content/features/footer/__init__.py Fri Jul 26 13:04:54 2019 +0200 @@ -10,9 +10,8 @@ # FOR A PARTICULAR PURPOSE. # -__docformat__ = 'restructuredtext' - from persistent import Persistent +from pyams_cache.beaker import get_cache from pyramid.events import subscriber from zope.lifecycleevent.interfaces import IObjectModifiedEvent from zope.location import Location @@ -20,10 +19,11 @@ from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary from zope.traversing.interfaces import ITraversable -from pyams_cache.beaker import get_cache from pyams_content.features.footer.interfaces import FOOTER_RENDERERS, FOOTER_RENDERER_SETTINGS_KEY, \ FOOTER_SETTINGS_KEY, IFooterRenderer, IFooterRendererSettings, IFooterSettings, IFooterTarget from pyams_content.features.renderer import RenderedContentMixin +from pyams_form.interfaces.form import IFormContextPermissionChecker +from pyams_portal.interfaces import MANAGE_TEMPLATE_PERMISSION from pyams_portal.portlet import PORTLETS_CACHE_NAME, PORTLETS_CACHE_REGION from pyams_utils.adapter import ContextAdapter, adapter_config, get_annotation_adapter from pyams_utils.factory import factory_config @@ -33,6 +33,9 @@ from pyams_utils.vocabulary import vocabulary_config +__docformat__ = 'restructuredtext' + + @factory_config(IFooterSettings) class FooterSettings(BaseInheritInfo, RenderedContentMixin, Persistent, Location): """Footer settings persistent class""" @@ -117,6 +120,13 @@ return IFooterRendererSettings(settings, None) +@adapter_config(context=IFooterRendererSettings, provides=IFormContextPermissionChecker) +class FooterRendererSettingsPermissionChecker(ContextAdapter): + """Footer renderer settings permission checker""" + + edit_permission = MANAGE_TEMPLATE_PERMISSION + + @vocabulary_config(name=FOOTER_RENDERERS) class FooterRendererVocabulary(SimpleVocabulary): """Footer renderers vocabulary"""