From a81af4583238abbea7f9308397fd89fd615651a1 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 25 Jan 2009 05:22:32 +0000 Subject: Speed tweak. --- repoze/bfg/security.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/repoze/bfg/security.py b/repoze/bfg/security.py index 2b1d3e0de..5ad3174da 100644 --- a/repoze/bfg/security.py +++ b/repoze/bfg/security.py @@ -68,10 +68,10 @@ class ACLAuthorizer(object): self.context = context def permits(self, permission, *principals): - acl = getattr(self.context, '__acl__', None) - if acl is None: - raise NoAuthorizationInformation('%s item has no __acl__' % - self.context) + try: + acl = self.context.__acl__ + except AttributeError: + raise NoAuthorizationInformation for ace in acl: ace_action, ace_principal, ace_permissions = ace -- cgit v1.2.3