From b54cdb6d0951a28b7d7bf4f585a4059cc5e6b18a Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 20 Jul 2008 08:41:08 +0000 Subject: - Add API functions for authenticated_userid and effective_principals. --- repoze/bfg/interfaces.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'repoze/bfg/interfaces.py') 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 -- cgit v1.2.3