Updated portlet renderer adapters
authorThierry Florac <thierry.florac@onf.fr>
Tue, 11 Oct 2016 16:04:24 +0200
changeset 14 7adb05065e32
parent 13 2ba62c6a9086
child 15 e917d512adbf
Updated portlet renderer adapters
src/pyams_portal/portlets/content/__init__.py
src/pyams_portal/portlets/image/__init__.py
--- a/src/pyams_portal/portlets/content/__init__.py	Thu Jun 02 16:09:21 2016 +0200
+++ b/src/pyams_portal/portlets/content/__init__.py	Tue Oct 11 16:04:24 2016 +0200
@@ -19,7 +19,7 @@
 from .interfaces import IContentPortletSettings
 from pyams_portal.interfaces import IPortletRenderer, IPortalContext
 from pyams_skin.layer import IPyAMSLayer
-from pyams_utils.interfaces import VIEW_PERMISSION
+from pyams_utils.interfaces import PUBLIC_PERMISSION
 
 # import packages
 from pyams_portal.portlet import PortletSettings, Portlet, PortletRenderer, portlet_config
@@ -38,7 +38,7 @@
     """Content portlet persistent settings"""
 
 
-@portlet_config(permission=VIEW_PERMISSION)
+@portlet_config(permission=PUBLIC_PERMISSION)
 class ContentPortlet(Portlet):
     """Content portlet"""
 
@@ -48,7 +48,7 @@
     settings_class = ContentPortletSettings
 
 
-@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, ContentPortlet), provides=IPortletRenderer)
+@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, IContentPortletSettings), provides=IPortletRenderer)
 @template_config(template='content.pt', layer=IPyAMSLayer)
 class ContentPortletRenderer(PortletRenderer):
     """Content portlet renderer"""
--- a/src/pyams_portal/portlets/image/__init__.py	Thu Jun 02 16:09:21 2016 +0200
+++ b/src/pyams_portal/portlets/image/__init__.py	Tue Oct 11 16:04:24 2016 +0200
@@ -19,7 +19,7 @@
 from .interfaces import IImagePortletSettings
 from pyams_portal.interfaces import IPortalContext, IPortletRenderer
 from pyams_skin.layer import IPyAMSLayer
-from pyams_utils.interfaces import VIEW_PERMISSION
+from pyams_utils.interfaces import PUBLIC_PERMISSION
 
 # import packages
 from pyams_file.property import FileProperty
@@ -41,7 +41,7 @@
     image = FileProperty(IImagePortletSettings['image'])
 
 
-@portlet_config(permission=VIEW_PERMISSION)
+@portlet_config(permission=PUBLIC_PERMISSION)
 class ImagePortlet(Portlet):
     """Image portlet"""
 
@@ -54,7 +54,7 @@
     settings_class = ImagePortletSettings
 
 
-@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, ImagePortlet), provides=IPortletRenderer)
+@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, IImagePortletSettings), provides=IPortletRenderer)
 @template_config(template='image.pt', layer=IPyAMSLayer)
 class ImagePortletRenderer(PortletRenderer):
     """Image portlet renderer"""