1. Elliot Peele
  2. authztest

Commits

Elliot Peele  committed 4c54bdb Draft

add missing file

  • Participants
  • Parent commits 9c4dc80
  • Branches default

Comments (0)

Files changed (1)

File authztest/auth.py

View file
+import logging
+
+from pyramid.authorization import ACLAuthorizationPolicy
+
+log = logging.getLogger('authztest.auth')
+
+class AuthorizationPolicy(ACLAuthorizationPolicy):
+    def permits(self, context, principals, permission):
+        log.debug('authz policy: permits called')
+        ret = ACLAuthorizationPolicy.permits(self, context, principals,
+            permission)
+        return ret
+
+    def principals_allowed_by_permission(self, context, permission):
+        log.debug('authz policy: allowed_by_permission called')
+        ret = ACLAuthorizationPolicy.principals_allowed_by_permission(self,
+            context, permission)
+        return ret