diff MoinMoin/app.py @ 1037:1aa200340d17 namespaces

New routing middleware based on namespaces, details see below. Dispatch to different backends based on a namespace, so e.g. SomePage -> use content/default backend userprofiles:JoeDoe -> use userprofile backend If you do not give a NAMESPACE item in the metadata, it will parse the NAME item and create the NAMESPACE item (and modify the NAME item to only have the name without namespace). Uses 3 mappings: * namespace_mapping: namespace prefix -> backend_name * backend_mapping: backend_name -> Backend * acl mapping: maps namespace:itemname prefixes to sets of acls namespace_mapping and backend_mapping are kept separate so we can map different namespaces into same backend (this is possible as NAMESPACE key is stored in meta data). We also need to have a backend name anyway for serialization. ACLs might not use it correctly right now (one has to give namespace:itemname) to the acl check.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 01 Nov 2011 16:20:04 -0200
parents a4d4c74721bc
children f5e17549eda3
line wrap: on
line diff
--- a/MoinMoin/app.py	Mon Oct 31 01:03:24 2011 -0200
+++ b/MoinMoin/app.py	Tue Nov 01 16:20:04 2011 -0200
@@ -164,7 +164,7 @@
     # A ns_mapping consists of several lines, where each line is made up like this:
     # mountpoint, unprotected backend
     # Just initialize with unprotected backends.
-    app.router = routing.Backend(app.cfg.namespace_mapping)
+    app.router = routing.Backend(app.cfg.namespace_mapping, app.cfg.backend_mapping)
     if app.cfg.create_storage: