changeset 2192:ab895b8095c4

security: fix spelling, remove unneeded import
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 30 Apr 2007 20:12:27 +0200
parents fc90d8319bba
children cb913c851e91
files MoinMoin/security/__init__.py
diffstat 1 files changed, 14 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/security/__init__.py	Mon Apr 30 17:27:34 2007 +0200
+++ b/MoinMoin/security/__init__.py	Mon Apr 30 20:12:27 2007 +0200
@@ -11,11 +11,11 @@
     Then assign your new class to "SecurityPolicy" in wikiconfig;
     and I mean the class, not an instance of it!
 
-    @copyright: 2000-2004 Juergen Hermann <jh@web.de>
-                2003 by Thomas Waldmann, http://linuxwiki.de/ThomasWaldmann
-                2003 by Gustavo Niemeyer, http://moin.conectiva.com.br/GustavoNiemeyer
-                2005 by Oliver Graf
-                2007 by Alexander Schremmer
+    @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
+                2003 MoinMoin:ThomasWaldmann,
+                2003 Gustavo Niemeyer,
+                2005 Oliver Graf,
+                2007 Alexander Schremmer
     @license: GNU GPL, see COPYING for details.
 """
 
@@ -29,7 +29,7 @@
 
 def _check(request, pagename, user, right):
     if request.cfg.acl_hierarchic:
-        return _checkHierarchicly(request, pagename, user, right)
+        return _checkHierarchically(request, pagename, user, right)
 
     if request.page is not None and pagename == request.page.page_name:
         p = request.page # reuse is good
@@ -39,26 +39,22 @@
     return acl.may(request, user, right)
 
     
-def _checkHierarchicly(request, pagename, username, attr):
-    """ Get permission by transversing page hierarchy
+def _checkHierarchically(request, pagename, username, attr):
+    """ Get permission by traversing page hierarchy
 
-    We check each page in the hierarchy. We start
-    with the deepest page and recurse to the top of the tree. If one of those 
-    permits, True is returned. 
+    We check each page in the hierarchy. We start with the deepest page and
+    recurse to the top of the tree. If one of those permits, True is returned. 
 
-    This method should not be called by users, use __getattr__
-    instead. 
+    This method should not be called by users, use __getattr__ instead. 
 
     @param request: the current request object
-    @param pagename: pagename to get permission from
+    @param pagename: pagename to get permissions from
     @param username: the user name
     @param attr: the attribute to check
 
     @rtype: bool
     @return: True if you have permission or False
     """
-    from MoinMoin.Page import Page
-
     # Use page hierarchy
     pages = pagename.split('/')
 
@@ -71,7 +67,7 @@
     some_acl = False
     for i in range(len(pages), 0, -1):
         # Create the next pagename in the hierarchy
-        # starting with the leave, going to the root
+        # starting at the leaf, going to the root
         name = '/'.join(pages[:i])
         # Get page acl and ask for permission
         acl = Page(request, name).getACL(request)
@@ -101,7 +97,7 @@
 
     When sub classing this class, you must extend the class methods, not
     replace them, or you might break the acl in the wiki. Correct sub
-    classing look like this:
+    classing looks like this:
 
     def read(self, pagename):
         # Your special security rule