changeset 4821:fe472a24fbcc

Groups2009: security.autoadmin works wit the new groups code.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Thu, 25 Jun 2009 14:48:47 +0200
parents 17e9325712b3
children d44a9c23438c
files MoinMoin/security/autoadmin.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/security/autoadmin.py	Thu Jun 25 12:55:21 2009 +0200
+++ b/MoinMoin/security/autoadmin.py	Thu Jun 25 14:48:47 2009 +0200
@@ -69,14 +69,15 @@
     def admin(self, pagename):
         try:
             request = self.request
-            has_member = request.dicts.has_member
+            groups = request.groups
             username = request.user.name
             pagename = request.page.page_name
             mainpage = pagename.split('/')[0]
-            if username == mainpage and has_member('AutoAdminGroup', username):
+            if username == mainpage and u'AutoAdminGroup' in groups and username in groups[u'AutoAdminGroup']:
                 return True
-            groupname = "%s/AdminGroup" % mainpage
-            if has_member(groupname, username) and has_member('AutoAdminGroup', groupname):
+            group_name = "%s/AdminGroup" % mainpage
+            if group_name in groups and username in groups[group_name] and \
+                    u'AutoAdminGroup' in groups and group_name in groups[u'AutoAdminGroup']:
                 return True
         except AttributeError:
             pass # when we get called from xmlrpc, there is no request.page