diff options
| -rw-r--r-- | pyramid/tests/test_authorization.py | 9 |
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: |
