Skip to content
Browse files

- When no authentication policy was configured, a call to

  ``pyramid.security.effective_principals`` would unconditionally return the
  empty list.  This was incorrect, it should have unconditionally returned
  ``[Everyone]``, and now does.
  • Loading branch information...
1 parent 4321a44 commit 8782def302a98cefdd4a4c1d448f5226acf81103 @mcdonc mcdonc committed Mar 30, 2012
Showing with 8 additions and 2 deletions.
  1. +5 −0 CHANGES.txt
  2. +1 −1 pyramid/security.py
  3. +2 −1 pyramid/tests/test_security.py
View
5 CHANGES.txt
@@ -18,6 +18,11 @@ Bug Fixes
it can work on Windows. See https://github.com/Pylons/pyramid/issues/512
for more information.
+- When no authentication policy was configured, a call to
+ ``pyramid.security.effective_principals`` would unconditionally return the
+ empty list. This was incorrect, it should have unconditionally returned
+ ``[Everyone]``, and now does.
+
1.3 (2012-03-21)
================
View
2 pyramid/security.py
@@ -100,7 +100,7 @@ def effective_principals(request):
policy = reg.queryUtility(IAuthenticationPolicy)
if policy is None:
- return []
+ return [Everyone]
return policy.effective_principals(request)
def principals_allowed_by_permission(context, permission):
View
3 pyramid/tests/test_security.py
@@ -266,9 +266,10 @@ def _callFUT(self, request):
return effective_principals(request)
def test_no_authentication_policy(self):
+ from pyramid.security import Everyone
request = _makeRequest()
result = self._callFUT(request)
- self.assertEqual(result, [])
+ self.assertEqual(result, [Everyone])
def test_with_authentication_policy(self):
request = _makeRequest()

0 comments on commit 8782def

Please sign in to comment.
Something went wrong with that request. Please try again.