summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2013-03-18 20:53:14 -0700
committerMichael Merickel <michael@merickel.org>2013-03-18 21:00:25 -0700
commit038dcbaea40ee6e4526946115cc4c8c9bfb43c2f (patch)
tree843ce17e9eec6a7c772a901807ccc434e563da0b
parentbebe236dbaa87fb9298bcc0bb27aa7b246b12e35 (diff)
downloadpyramid-038dcbaea40ee6e4526946115cc4c8c9bfb43c2f.tar.gz
pyramid-038dcbaea40ee6e4526946115cc4c8c9bfb43c2f.tar.bz2
pyramid-038dcbaea40ee6e4526946115cc4c8c9bfb43c2f.zip
add failing test for callable acl
-rw-r--r--pyramid/tests/test_authorization.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/pyramid/tests/test_authorization.py b/pyramid/tests/test_authorization.py
index 27f2a18b4..60b1b0c8d 100644
--- a/pyramid/tests/test_authorization.py
+++ b/pyramid/tests/test_authorization.py
@@ -215,6 +215,15 @@ class TestACLAuthorizationPolicy(unittest.TestCase):
result = sorted(
policy.principals_allowed_by_permission(context, 'read'))
self.assertEqual(result, [])
+
+ def test_callable_acl(self):
+ from pyramid.security import Allow
+ context = DummyContext()
+ fn = lambda self: [(Allow, 'bob', 'read')]
+ context.__acl__ = fn.__get__(context, context.__class__)
+ policy = self._makeOne()
+ result = policy.permits(context, ['bob'], 'read')
+ self.assertTrue(result)
class DummyContext: