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:
|
if options:
|
||||||
return 'useVersioning' in options.value
|
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
|
@Lazy
|
||||||
def versionLevels(self):
|
def versionLevels(self):
|
||||||
if self.versionable is not None:
|
if self.versionable is not None:
|
||||||
|
|
|
@ -47,9 +47,8 @@
|
||||||
<!-- portlets -->
|
<!-- portlets -->
|
||||||
|
|
||||||
<metal:versions define-macro="portlet_versions">
|
<metal:versions define-macro="portlet_versions">
|
||||||
<div>
|
<div tal:condition="view/showVersions|python:True">
|
||||||
<a href="#"
|
<a tal:attributes="href string:${view/url}/.${macro/info/uniqueId}?loops.viewName=listversions">
|
||||||
tal:attributes="href string:${view/url}/.${macro/info/uniqueId}?loops.viewName=listversions">
|
|
||||||
<span i18n:translate="">All versions</span>
|
<span i18n:translate="">All versions</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue