diff options
| author | Chris McDonough <chrism@plope.com> | 2011-03-28 08:59:14 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-03-28 08:59:14 -0400 |
| commit | 8c4eb9e365e7167b0f002eb9ad44634debd56957 (patch) | |
| tree | 1ed9b657a12e9e8e51de435c2a5a67f2f8c1eaaa | |
| parent | a0adb6ae4cac5ff59d495ee53c7efee216866c02 (diff) | |
| download | pyramid-8c4eb9e365e7167b0f002eb9ad44634debd56957.tar.gz pyramid-8c4eb9e365e7167b0f002eb9ad44634debd56957.tar.bz2 pyramid-8c4eb9e365e7167b0f002eb9ad44634debd56957.zip | |
branch coverage
| -rw-r--r-- | pyramid/config.py | 6 |
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) |
