summaryrefslogtreecommitdiff
path: root/repoze/bfg/interfaces.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2008-07-20 08:41:08 +0000
committerChris McDonough <chrism@agendaless.com>2008-07-20 08:41:08 +0000
commitb54cdb6d0951a28b7d7bf4f585a4059cc5e6b18a (patch)
tree0b600c099bdec04c46c13512689c59c9ec8dadac /repoze/bfg/interfaces.py
parentae0b3f07e3e6b8d6cde11ddf2fead38b7fc8dfd3 (diff)
downloadpyramid-b54cdb6d0951a28b7d7bf4f585a4059cc5e6b18a.tar.gz
pyramid-b54cdb6d0951a28b7d7bf4f585a4059cc5e6b18a.tar.bz2
pyramid-b54cdb6d0951a28b7d7bf4f585a4059cc5e6b18a.zip
- Add API functions for authenticated_userid and effective_principals.
Diffstat (limited to 'repoze/bfg/interfaces.py')
-rw-r--r--repoze/bfg/interfaces.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py
index 710b91074..fee7b8d61 100644
--- a/repoze/bfg/interfaces.py
+++ b/repoze/bfg/interfaces.py
@@ -46,6 +46,15 @@ class ISecurityPolicy(Interface):
information in the context and the authentication data in
the request allow the action implied by the permission """
+ def authenticated_userid(request):
+ """ Return the userid of the currently authenticated user or
+ None if there is no currently authenticated user """
+
+ def effective_principals(request):
+ """ Return the list of 'effective' principals for the request.
+ This must include the userid of the currently authenticated
+ user if a user is currently authenticated."""
+
class NoAuthorizationInformation(Exception):
pass