diff --git a/CHANGES.rst b/CHANGES.rst index da53f0e5..87f1418f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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,10 @@ 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. Fixes #84. [thet] @@ -1708,3 +1712,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 dabcb602..9ce1fee6 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 c98e5e3a..24b9e32a 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