changeset 2189:a37491dbb605

Correctly check the ACL lists in the PageEditor for the admin check instead of the wrapping objects, reordered some comments and doc strings, return None instead of 0 in may if applicable. Should be ported to 1.7.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Mon, 30 Apr 2007 16:21:08 +0200
parents 30a153cfa8f8
children a34d054835d3
files MoinMoin/PageEditor.py MoinMoin/security/__init__.py
diffstat 2 files changed, 6 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Mon Apr 30 12:27:03 2007 +0200
+++ b/MoinMoin/PageEditor.py	Mon Apr 30 16:21:08 2007 +0200
@@ -1018,7 +1018,7 @@
             # of wating for next request.
             acl = self.getACL(request)
             if (not request.user.may.admin(self.page_name) and
-                parseACL(request, newtext) != acl and
+                parseACL(request, newtext).acl != acl.acl and
                 action != "SAVE/REVERT"):
                 msg = _("You can't change ACLs on this page since you have no admin rights on it!")
                 raise self.NoAdmin, msg
--- a/MoinMoin/security/__init__.py	Mon Apr 30 12:27:03 2007 +0200
+++ b/MoinMoin/security/__init__.py	Mon Apr 30 16:21:08 2007 +0200
@@ -1,6 +1,7 @@
 # -*- coding: iso-8859-1 -*-
 """
-    MoinMoin - Wiki Security Interface
+    MoinMoin - Wiki Security Interface and Access Control Lists
+
 
     This implements the basic interface for user permissions and
     system policy. If you want to define your own policy, inherit
@@ -11,6 +12,8 @@
     and I mean the class, not an instance of it!
 
     @copyright: 2000-2004 Juergen Hermann <jh@web.de>
+    @copyright: 2003 by Thomas Waldmann, http://linuxwiki.de/ThomasWaldmann
+    @copyright: 2003 by Gustavo Niemeyer, http://moin.conectiva.com.br/GustavoNiemeyer
     @license: GNU GPL, see COPYING for details.
 """
 
@@ -63,20 +66,10 @@
         else:
             raise AttributeError, attr
 
-
 # make an alias for the default policy
 Default = Permissions
 
 
-# moved from MoinMoin.wikiacl ------------------------------------------------
-"""
-    MoinMoin Access Control Lists
-
-    @copyright: 2003 by Thomas Waldmann, http://linuxwiki.de/ThomasWaldmann
-    @copyright: 2003 by Gustavo Niemeyer, http://moin.conectiva.com.br/GustavoNiemeyer
-    @license: GNU GPL, see COPYING for details.
-"""
-
 class AccessControlList:
     ''' Access Control List
 
@@ -254,7 +247,7 @@
                 allowed = rightsdict.get(dowhat)
             if allowed is not None:
                 return allowed
-        return 0
+        return allowed # should be None
 
     def getString(self, b='#acl ', e='\n'):
         """print the acl strings we were fed with"""