optionally restrict version listing
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@4061 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
16f91fc165
commit
99fc384e8f
2 changed files with 13 additions and 3 deletions
|
@ -499,6 +499,17 @@ class BaseView(GenericView, I18NView):
|
|||
if options:
|
||||
return 'useVersioning' in options.value
|
||||
|
||||
@Lazy
|
||||
def showVersions(self):
|
||||
permissions = self.globalOptions('showVersionsPermissions')
|
||||
if permissions:
|
||||
for p in permissions:
|
||||
if checkPermission(p, self.target):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return True
|
||||
|
||||
@Lazy
|
||||
def versionLevels(self):
|
||||
if self.versionable is not None:
|
||||
|
|
|
@ -47,9 +47,8 @@
|
|||
<!-- portlets -->
|
||||
|
||||
<metal:versions define-macro="portlet_versions">
|
||||
<div>
|
||||
<a href="#"
|
||||
tal:attributes="href string:${view/url}/.${macro/info/uniqueId}?loops.viewName=listversions">
|
||||
<div tal:condition="view/showVersions|python:True">
|
||||
<a tal:attributes="href string:${view/url}/.${macro/info/uniqueId}?loops.viewName=listversions">
|
||||
<span i18n:translate="">All versions</span>
|
||||
</a>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue