diff MoinMoin/action/AttachFile.py @ 448:45924beef130

user.isSuperUser() check, require cfg.superuser being a list or tuple imported from: moin--main--1.5--patch-452
author Thomas Waldmann <tw@waldmann-edv.de>
date Sat, 18 Feb 2006 15:31:50 +0000
parents 8a750c0d229a
children 77526f8f3ecf
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sat Feb 18 14:21:40 2006 +0000
+++ b/MoinMoin/action/AttachFile.py	Sat Feb 18 15:31:50 2006 +0000
@@ -259,7 +259,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.name in request.cfg.superuser):
+                request.user.isSuperUser()):
                 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
                 request.user.may.read(pagename) and request.user.may.delete(pagename)
@@ -480,7 +480,7 @@
          else:
             msg = _('You are not allowed to unzip attachments of this page.')
     elif request.form['do'][0] == 'install':
-         if request.user.name in request.cfg.superuser:
+         if request.user.isSuperUser():
             install_package(pagename, request)
          else:
             msg = _('You are not allowed to install files.')