changeset 188:cad306a58919

Permissions: determine correct backend for item and query permissions at that backend
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 24 Apr 2011 15:44:43 +0200
parents f8d5d3643572
children 2a51aa7fe632
files MoinMoin/security/__init__.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/security/__init__.py	Sun Apr 24 14:52:12 2011 +0200
+++ b/MoinMoin/security/__init__.py	Sun Apr 24 15:44:43 2011 +0200
@@ -75,9 +75,10 @@
         :returns: checking function for that right
         """
         if attr in app.cfg.acl_rights_contents:
-            ns_content = app.cfg.ns_content # XXX always uses content backend
-            may = flaskg.storage.get_backend(ns_content)._may
-            return lambda itemname: may(itemname, attr, username=self.name)
+            def may(itemname):
+                backend = flaskg.storage._get_backend(itemname)[0]
+                return backend._may(itemname, attr, username=self.name)
+            return may
         if attr in app.cfg.acl_rights_functions:
             may = app.cfg.cache.acl_functions.may
             return lambda: may(self.name, attr)