--- a/src/pyams_security/utility.py Thu Jun 02 16:19:18 2016 +0200
+++ b/src/pyams_security/utility.py Thu Jun 02 16:20:29 2016 +0200
@@ -289,11 +289,12 @@
return self.cookie.forget(request)
-def get_principal(request):
+def get_principal(request, principal_id=None):
"""Get principal associated with given request"""
manager = query_utility(ISecurityManager)
if manager is not None:
- principal_id = request.authenticated_userid
+ if principal_id is None:
+ principal_id = request.authenticated_userid
if principal_id:
return manager.get_principal(principal_id)
else: