From: Benoît Pin Date: Sun, 6 Jul 2014 05:42:01 +0000 (+0200) Subject: Prise en charge des permissions dans l'affichage / masquage de la barre d'outils. X-Git-Url: https://svn.cri.ensmp.fr/git/Portfolio.git/commitdiff_plain/7e38e85702295952deaaf04fda5bb44dd2550524?ds=sidebyside;hp=e3221dd5738f0c8410573ae0980e7c8c2065b32c Prise en charge des permissions dans l'affichage / masquage de la barre d'outils. --- diff --git a/skins/getPhotoInfo.py b/skins/getPhotoInfo.py index 2947778..bb4391d 100755 --- a/skins/getPhotoInfo.py +++ b/skins/getPhotoInfo.py @@ -1,6 +1,6 @@ ##parameters= from Products.CMFCore.utils import getToolByName -from Products.CMFCore.permissions import ReviewPortalContent +from Products.CMFCore.permissions import ReviewPortalContent, ModifyPortalContent mtool = getToolByName(context, 'portal_membership') pptool = getToolByName(context, 'portal_photo_print', None) uidtool = getToolByName(context, 'portal_uidhandler') @@ -17,6 +17,9 @@ features['cart'] = lambda o : '%s/get_slide_buyable_items' % o.absolute_url() if mtool.checkPermission(ReviewPortalContent, context) : features['hideAnonymous'] = True +if mtool.checkPermission(ModifyPortalContent, context) : + features['checkbox'] = True + sd = context.session_data_manager.getSessionData(create = 1) selDict = sd.get('objects_selection_dict', {}) diff --git a/skins/getPhotosInfos.py b/skins/getPhotosInfos.py index 1679c40..2d42635 100755 --- a/skins/getPhotosInfos.py +++ b/skins/getPhotosInfos.py @@ -1,7 +1,7 @@ ##parameters=portfolio from Products.Plinn.PloneMisc import Batch from Products.CMFCore.utils import getToolByName -from Products.CMFCore.permissions import ReviewPortalContent +from Products.CMFCore.permissions import ReviewPortalContent, ModifyPortalContent mtool = getToolByName(context, 'portal_membership') pptool = getToolByName(context, 'portal_photo_print', None) uidtool = getToolByName(context, 'portal_uidhandler') @@ -18,6 +18,8 @@ features['cart'] = lambda o : '%s/get_slide_buyable_items' % o.absolute_url() if mtool.checkPermission(ReviewPortalContent, context) : features['hideAnonymous'] = True +if mtool.checkPermission(ModifyPortalContent, context) : + features['checkbox'] = True req = context.REQUEST pho_start = req.get('pho_start', 0) diff --git a/skins/photo_layout_macros.pt b/skins/photo_layout_macros.pt index 1ca17fa..f6003ba 100644 --- a/skins/photo_layout_macros.pt +++ b/skins/photo_layout_macros.pt @@ -66,7 +66,7 @@ i18n:attributes="alt"/> - + diff --git a/skins/portfolio_view.pt b/skins/portfolio_view.pt index 5535fa8..96a5882 100644 --- a/skins/portfolio_view.pt +++ b/skins/portfolio_view.pt @@ -67,7 +67,9 @@ features batchInfos/features" tal:omit-tag="">
-
+