summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-03-28 08:59:14 -0400
committerChris McDonough <chrism@plope.com>2011-03-28 08:59:14 -0400
commit8c4eb9e365e7167b0f002eb9ad44634debd56957 (patch)
tree1ed9b657a12e9e8e51de435c2a5a67f2f8c1eaaa
parenta0adb6ae4cac5ff59d495ee53c7efee216866c02 (diff)
downloadpyramid-8c4eb9e365e7167b0f002eb9ad44634debd56957.tar.gz
pyramid-8c4eb9e365e7167b0f002eb9ad44634debd56957.tar.bz2
pyramid-8c4eb9e365e7167b0f002eb9ad44634debd56957.zip
branch coverage
-rw-r--r--pyramid/config.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pyramid/config.py b/pyramid/config.py
index 1f4b85de0..906c5f935 100644
--- a/pyramid/config.py
+++ b/pyramid/config.py
@@ -395,13 +395,13 @@ class Configurator(object):
@action_method
def _set_security_policies(self, authentication, authorization=None):
- if authorization is None:
- authorization = ACLAuthorizationPolicy() # default
- if authorization and not authentication:
+ if (authorization is not None) and (not authentication):
raise ConfigurationError(
'If the "authorization" is passed a value, '
'the "authentication" argument must also be '
'passed a value; authorization requires authentication.')
+ if authorization is None:
+ authorization = ACLAuthorizationPolicy() # default
self._set_authentication_policy(authentication)
self._set_authorization_policy(authorization)