summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)