From 5c258990719498596e4143c71ad52624525f5385 Mon Sep 17 00:00:00 2001 From: jensens Date: Fri, 3 Jun 2016 01:06:06 +0200 Subject: [PATCH] [fc] Repository: plone.app.layout Branch: refs/heads/master Date: 2016-05-05T11:48:48-03:00 Author: hvelarde (hvelarde) Commit: https://github.com/plone/plone.app.layout/commit/1845be16f68cec3fea635032212259d8dac6de58 Document byline viewlet is now displayed only to anonymous users If permited by the Allow anyone to view 'about' information option in the Security Settings of Site Setup. Refs: https://github.com/plone/Products.CMFPlone/issues/1556 Files changed: M CHANGES.rst M plone/app/layout/viewlets/content.py Repository: plone.app.layout Branch: refs/heads/master Date: 2016-05-05T18:48:15-03:00 Author: hvelarde (hvelarde) Commit: https://github.com/plone/plone.app.layout/commit/7a603af3ef2d387e77507e3f1f1a11e447010658 Remove code used to show the lock status and history view in the document byline, as this information was not available to anonymous users anyway We need to review if this is available in the current implementation of the toolbar. Files changed: M CHANGES.rst M plone/app/layout/viewlets/content.py M plone/app/layout/viewlets/document_byline.pt M plone/app/layout/viewlets/tests/test_content.py Repository: plone.app.layout Branch: refs/heads/master Date: 2016-06-03T01:06:06+02:00 Author: Jens W. Klein (jensens) Commit: https://github.com/plone/plone.app.layout/commit/5e486e8604c683f4f7e1314389564e0d8ee77248 Merge pull request #90 from plone/issue_1556 Display document byline viewlet only to anonymous users Files changed: M CHANGES.rst M plone/app/layout/viewlets/content.py M plone/app/layout/viewlets/document_byline.pt M plone/app/layout/viewlets/tests/test_content.py --- last_commit.txt | 390 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 324 insertions(+), 66 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index 096ff86b03..80f8091d7c 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,100 +1,358 @@ -Repository: Products.CMFPlone +Repository: plone.app.layout Branch: refs/heads/master -Date: 2016-06-02T22:29:47+02:00 +Date: 2016-05-05T11:48:48-03:00 Author: hvelarde (hvelarde) -Commit: https://github.com/plone/Products.CMFPlone/commit/eba0fbc62093309af5e3dff9f91b4a6bb6887fdb +Commit: https://github.com/plone/plone.app.layout/commit/1845be16f68cec3fea635032212259d8dac6de58 -Do not hide document byline viewlet by default +Document byline viewlet is now displayed only to anonymous users -It is controled by the Allow anyone to view 'about' information option in the Security Settings of Site Setup. +If permited by the Allow anyone to view 'about' information option in the Security Settings of Site Setup. + +Refs: https://github.com/plone/Products.CMFPlone/issues/1556 Files changed: M CHANGES.rst -M Products/CMFPlone/profiles/default/viewlets.xml +M plone/app/layout/viewlets/content.py diff --git a/CHANGES.rst b/CHANGES.rst -index 7b9b6a4..3bed155 100644 +index da53f0e..9efcc5b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst -@@ -44,6 +44,10 @@ Fixes: - - Fixed versioning for File and Image. - [iham] +@@ -6,7 +6,7 @@ Changelog + + Incompatibilities: + +-- Deprecated ``plone.app.layout.globals.pattern_settings``. ++- Deprecated ``plone.app.layout.globals.pattern_settings``. + Moved view to ``Products.CMFPlone.patterns.view``. + Deprecated also pointless interface for this view. + Addresses https://github.com/plone/Products.CMFPlone/issues/1513 and goes together with https://github.com/plone/Products.CMFPlone/issues/1514. +@@ -18,6 +18,9 @@ New: -+- Do not hide document byline viewlet by default; -+ it is controled by the `Allow anyone to view 'about' information` option in the `Security Settings` of `Site Setup` (closes `#1556`_). + Fixes: + ++- Document byline viewlet is now displayed only to anonymous users if permited by the `Allow anyone to view 'about' information` option in the `Security Settings` of `Site Setup` (closes `CMFPlone#1556`_). + [hvelarde] + - - Removed docstrings from some methods to avoid publishing them. From - Products.PloneHotfix20160419. [maurits] - -@@ -1296,3 +1300,4 @@ Fixes: - .. _`#1053`: https://github.com/plone/Products.CMFPlone/issues/1053 - .. _`#1232`: https://github.com/plone/Products.CMFPlone/issues/1232 - .. _`#1255`: https://github.com/plone/Products.CMFPlone/issues/1255 -+.. _`#1556`: https://github.com/plone/Products.CMFPlone/issues/1556 -diff --git a/Products/CMFPlone/profiles/default/viewlets.xml b/Products/CMFPlone/profiles/default/viewlets.xml -index 4ea8369..77d0fb4 100644 ---- a/Products/CMFPlone/profiles/default/viewlets.xml -+++ b/Products/CMFPlone/profiles/default/viewlets.xml -@@ -38,7 +38,4 @@ - - - -- -- -- - - - -Repository: Products.CMFPlone + - Fix body class ``pat-markspeciallinks`` not set. + Fixes #84. + [thet] +@@ -1708,3 +1711,4 @@ Fixes: + .. _`CMFPlone#1037`: https://github.com/plone/Products.CMFPlone/issues/1037 + .. _`CMFPlone#1151`: https://github.com/plone/Products.CMFPlone/issues/1151 + .. _`CMFPlone#1178`: https://github.com/plone/Products.CMFPlone/issues/1178 ++.. _`CMFPlone#1556`: https://github.com/plone/Products.CMFPlone/issues/1556 +diff --git a/plone/app/layout/viewlets/content.py b/plone/app/layout/viewlets/content.py +index dabcb60..c4aebbe 100644 +--- a/plone/app/layout/viewlets/content.py ++++ b/plone/app/layout/viewlets/content.py +@@ -71,7 +71,7 @@ def show(self): + ISecuritySchema, + prefix='plone', + ) +- return not self.anonymous or settings.allow_anon_views_about ++ return self.anonymous and settings.allow_anon_views_about + + def show_history(self): + has_access_preview_versions_permission = _checkPermission( + + +Repository: plone.app.layout + + +Branch: refs/heads/master +Date: 2016-05-05T18:48:15-03:00 +Author: hvelarde (hvelarde) +Commit: https://github.com/plone/plone.app.layout/commit/7a603af3ef2d387e77507e3f1f1a11e447010658 + +Remove code used to show the lock status and history view in the document byline, as this information was not available to anonymous users anyway + +We need to review if this is available in the current implementation of the toolbar. + +Files changed: +M CHANGES.rst +M plone/app/layout/viewlets/content.py +M plone/app/layout/viewlets/document_byline.pt +M plone/app/layout/viewlets/tests/test_content.py + +diff --git a/CHANGES.rst b/CHANGES.rst +index 9efcc5b..87f1418 100644 +--- a/CHANGES.rst ++++ b/CHANGES.rst +@@ -19,6 +19,7 @@ New: + Fixes: + + - Document byline viewlet is now displayed only to anonymous users if permited by the `Allow anyone to view 'about' information` option in the `Security Settings` of `Site Setup` (closes `CMFPlone#1556`_). ++ Code used to show the lock status and history view was removed from the document byline as this information was not available to anonymous users anyway. + [hvelarde] + + - Fix body class ``pat-markspeciallinks`` not set. +diff --git a/plone/app/layout/viewlets/content.py b/plone/app/layout/viewlets/content.py +index c4aebbe..9ce1fee 100644 +--- a/plone/app/layout/viewlets/content.py ++++ b/plone/app/layout/viewlets/content.py +@@ -73,42 +73,6 @@ def show(self): + ) + return self.anonymous and settings.allow_anon_views_about + +- def show_history(self): +- has_access_preview_versions_permission = _checkPermission( +- 'CMFEditions: Access previous versions', +- self.context +- ) +- if not has_access_preview_versions_permission: +- return False +- if IViewView.providedBy(self.__parent__): +- return True +- if IFolderContentsView.providedBy(self.__parent__): +- return True +- return False +- +- def locked_icon(self): +- if not getSecurityManager().checkPermission('Modify portal content', +- self.context): +- return "" +- +- locked = False +- lock_info = queryMultiAdapter((self.context, self.request), +- name='plone_lock_info') +- if lock_info is not None: +- locked = lock_info.is_locked() +- else: +- context = aq_inner(self.context) +- lockable = getattr( +- context.aq_explicit, 'wl_isLocked', None) is not None +- locked = lockable and context.wl_isLocked() +- +- if not locked: +- return "" +- +- portal = self.portal_state.portal() +- icon = portal.restrictedTraverse('lock_icon.png') +- return icon.tag(title='Locked') +- + def creator(self): + return self.context.Creator() + +diff --git a/plone/app/layout/viewlets/document_byline.pt b/plone/app/layout/viewlets/document_byline.pt +index c98e5e3..24b9e32 100644 +--- a/plone/app/layout/viewlets/document_byline.pt ++++ b/plone/app/layout/viewlets/document_byline.pt +@@ -2,12 +2,6 @@ + id="plone-document-byline" + i18n:domain="plone" + tal:condition="view/show"> +- +- +- +- + + expired + + +- +- — +- History +- +- +
' +- ) +- self.assertEqual(viewlet.locked_icon(), lockIconUrl) +- + def test_pub_date(self): + # configure our portal to enable publication date on pages globally on + # the site + + +Repository: plone.app.layout Branch: refs/heads/master -Date: 2016-06-03T01:05:46+02:00 +Date: 2016-06-03T01:06:06+02:00 Author: Jens W. Klein (jensens) -Commit: https://github.com/plone/Products.CMFPlone/commit/5981f38e1622d1f25599a6474c488a4f2d3c7ed2 +Commit: https://github.com/plone/plone.app.layout/commit/5e486e8604c683f4f7e1314389564e0d8ee77248 -Merge pull request #1574 from plone/issue_1556 +Merge pull request #90 from plone/issue_1556 -Do not hide document byline viewlet by default +Display document byline viewlet only to anonymous users Files changed: M CHANGES.rst -M Products/CMFPlone/profiles/default/viewlets.xml +M plone/app/layout/viewlets/content.py +M plone/app/layout/viewlets/document_byline.pt +M plone/app/layout/viewlets/tests/test_content.py diff --git a/CHANGES.rst b/CHANGES.rst -index 7b9b6a4..3bed155 100644 +index 62460d7..cc32ff5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst -@@ -44,6 +44,10 @@ Fixes: - - Fixed versioning for File and Image. - [iham] +@@ -22,7 +22,7 @@ Bug fixes: + + Incompatibilities: + +-- Deprecated ``plone.app.layout.globals.pattern_settings``. ++- Deprecated ``plone.app.layout.globals.pattern_settings``. + Moved view to ``Products.CMFPlone.patterns.view``. + Deprecated also pointless interface for this view. + Addresses https://github.com/plone/Products.CMFPlone/issues/1513 and goes together with https://github.com/plone/Products.CMFPlone/issues/1514. +@@ -30,6 +30,10 @@ Incompatibilities: -+- Do not hide document byline viewlet by default; -+ it is controled by the `Allow anyone to view 'about' information` option in the `Security Settings` of `Site Setup` (closes `#1556`_). + Fixes: + ++- Document byline viewlet is now displayed only to anonymous users if permited by the `Allow anyone to view 'about' information` option in the `Security Settings` of `Site Setup` (closes `CMFPlone#1556`_). ++ Code used to show the lock status and history view was removed from the document byline as this information was not available to anonymous users anyway. + [hvelarde] + - - Removed docstrings from some methods to avoid publishing them. From - Products.PloneHotfix20160419. [maurits] - -@@ -1296,3 +1300,4 @@ Fixes: - .. _`#1053`: https://github.com/plone/Products.CMFPlone/issues/1053 - .. _`#1232`: https://github.com/plone/Products.CMFPlone/issues/1232 - .. _`#1255`: https://github.com/plone/Products.CMFPlone/issues/1255 -+.. _`#1556`: https://github.com/plone/Products.CMFPlone/issues/1556 -diff --git a/Products/CMFPlone/profiles/default/viewlets.xml b/Products/CMFPlone/profiles/default/viewlets.xml -index 4ea8369..77d0fb4 100644 ---- a/Products/CMFPlone/profiles/default/viewlets.xml -+++ b/Products/CMFPlone/profiles/default/viewlets.xml -@@ -38,7 +38,4 @@ - - - -- -- -- - + - Fix body class ``pat-markspeciallinks`` not set. + Fixes #84. + [thet] +@@ -1720,3 +1724,4 @@ Fixes: + .. _`CMFPlone#1037`: https://github.com/plone/Products.CMFPlone/issues/1037 + .. _`CMFPlone#1151`: https://github.com/plone/Products.CMFPlone/issues/1151 + .. _`CMFPlone#1178`: https://github.com/plone/Products.CMFPlone/issues/1178 ++.. _`CMFPlone#1556`: https://github.com/plone/Products.CMFPlone/issues/1556 +diff --git a/plone/app/layout/viewlets/content.py b/plone/app/layout/viewlets/content.py +index dabcb60..9ce1fee 100644 +--- a/plone/app/layout/viewlets/content.py ++++ b/plone/app/layout/viewlets/content.py +@@ -71,43 +71,7 @@ def show(self): + ISecuritySchema, + prefix='plone', + ) +- return not self.anonymous or settings.allow_anon_views_about +- +- def show_history(self): +- has_access_preview_versions_permission = _checkPermission( +- 'CMFEditions: Access previous versions', +- self.context +- ) +- if not has_access_preview_versions_permission: +- return False +- if IViewView.providedBy(self.__parent__): +- return True +- if IFolderContentsView.providedBy(self.__parent__): +- return True +- return False +- +- def locked_icon(self): +- if not getSecurityManager().checkPermission('Modify portal content', +- self.context): +- return "" +- +- locked = False +- lock_info = queryMultiAdapter((self.context, self.request), +- name='plone_lock_info') +- if lock_info is not None: +- locked = lock_info.is_locked() +- else: +- context = aq_inner(self.context) +- lockable = getattr( +- context.aq_explicit, 'wl_isLocked', None) is not None +- locked = lockable and context.wl_isLocked() +- +- if not locked: +- return "" +- +- portal = self.portal_state.portal() +- icon = portal.restrictedTraverse('lock_icon.png') +- return icon.tag(title='Locked') ++ return self.anonymous and settings.allow_anon_views_about + + def creator(self): + return self.context.Creator() +diff --git a/plone/app/layout/viewlets/document_byline.pt b/plone/app/layout/viewlets/document_byline.pt +index c98e5e3..24b9e32 100644 +--- a/plone/app/layout/viewlets/document_byline.pt ++++ b/plone/app/layout/viewlets/document_byline.pt +@@ -2,12 +2,6 @@ + id="plone-document-byline" + i18n:domain="plone" + tal:condition="view/show"> +- +- +- +- + + expired + + +- +- — +- History +- +- +
' +- ) +- self.assertEqual(viewlet.locked_icon(), lockIconUrl) +- + def test_pub_date(self): + # configure our portal to enable publication date on pages globally on + # the site