changeset 2537:b257d7bc96ff

AttachFile:only superuser with write access to a page should get install dialog for packages
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Mon, 23 Jul 2007 14:36:04 +0200
parents 72a31f09d5a1
children 070294763d3e
files MoinMoin/action/AttachFile.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Mon Jul 23 13:11:10 2007 +0200
+++ b/MoinMoin/action/AttachFile.py	Mon Jul 23 14:36:04 2007 +0200
@@ -343,7 +343,7 @@
                 viewlink = '<a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&amp;do=view&amp;target=%(urlfile)s">%(label_view)s</a>' % parmdict
 
             if (packages.ZipPackage(request, os.path.join(attach_dir, file).encode(config.charset)).isPackage() and
-                 request.user.isSuperUser()):
+                 request.user.isSuperUser() and request.user.may.write(pagename)):
                 viewlink += ' | <a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&amp;do=install&amp;target=%(urlfile)s">%(label_install)s</a>' % parmdict
             elif (zipfile.is_zipfile(os.path.join(attach_dir, file).encode(config.charset)) and
                 mt.minor == 'zip' and request.user.may.read(pagename) and request.user.may.delete(pagename)