summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-05-27 23:49:11 +0000
committerChris McDonough <chrism@agendaless.com>2009-05-27 23:49:11 +0000
commitca555cb4c86810af35149c702eb945c5b9400df9 (patch)
tree6fbc985513e45cfe54e63c105f912a10345597fd
parentf4108da64a4f24d5710c7e03389a9316cf62d342 (diff)
downloadpyramid-ca555cb4c86810af35149c702eb945c5b9400df9.tar.gz
pyramid-ca555cb4c86810af35149c702eb945c5b9400df9.tar.bz2
pyramid-ca555cb4c86810af35149c702eb945c5b9400df9.zip
- Allow IAuthenticationPolicy and IAuthorizationPolicy to be
overridden via ZCML registrations (do ZCML parsing after registering these in router.py).
-rw-r--r--CHANGES.txt7
-rw-r--r--repoze/bfg/router.py25
2 files changed, 20 insertions, 12 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 0a476b3f0..9610e3713 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,13 @@
0.9dev (unreleased)
===================
+Features
+--------
+
+- Allow IAuthenticationPolicy and IAuthorizationPolicy to be
+ overridden via ZCML registrations (do ZCML parsing after
+ registering these in router.py).
+
Documentation
-------------
diff --git a/repoze/bfg/router.py b/repoze/bfg/router.py
index 1b535c442..92fc5b58a 100644
--- a/repoze/bfg/router.py
+++ b/repoze/bfg/router.py
@@ -325,18 +325,6 @@ def make_app(root_factory, package=None, filename='configure.zcml',
registry.registerUtility(settings, ISettings)
mapper = RoutesRootFactory(root_factory)
registry.registerUtility(mapper, IRoutesMapper)
- populateRegistry(registry, filename, package)
- if mapper.has_routes():
- # if the user had any <route/> statements in his configuration,
- # use the RoutesRootFactory as the root factory
- root_factory = mapper
- else:
- # otherwise, use only the supplied root_factory (unless it's None)
- if root_factory is None:
- raise ValueError(
- 'root_factory (aka get_root) was None and no routes connected')
-
- registry.registerUtility(root_factory, IRootFactory)
if authentication_policy:
registry.registerUtility(authentication_policy, IAuthenticationPolicy)
@@ -358,6 +346,19 @@ def make_app(root_factory, package=None, filename='configure.zcml',
'release.')
registerBBBAuthn(secpol, registry)
+ populateRegistry(registry, filename, package)
+ if mapper.has_routes():
+ # if the user had any <route/> statements in his configuration,
+ # use the RoutesRootFactory as the root factory
+ root_factory = mapper
+ else:
+ # otherwise, use only the supplied root_factory (unless it's None)
+ if root_factory is None:
+ raise ValueError(
+ 'root_factory (aka get_root) was None and no routes connected')
+
+ registry.registerUtility(root_factory, IRootFactory)
+
app = Router(registry)
# We push the registry on to the stack here in case any ZCA API is