diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-01-25 05:22:32 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-01-25 05:22:32 +0000 |
| commit | a81af4583238abbea7f9308397fd89fd615651a1 (patch) | |
| tree | 5a4278d7a8830061ce44e9cafd1d2b99c8d615a4 | |
| parent | cb4b8039c677a4907d999598b96505298a3e7401 (diff) | |
| download | pyramid-a81af4583238abbea7f9308397fd89fd615651a1.tar.gz pyramid-a81af4583238abbea7f9308397fd89fd615651a1.tar.bz2 pyramid-a81af4583238abbea7f9308397fd89fd615651a1.zip | |
Speed tweak.
| -rw-r--r-- | repoze/bfg/security.py | 8 |
1 files 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 |
