--- a/src/pyams_security/plugin/social.py Wed May 20 12:31:27 2015 +0200
+++ b/src/pyams_security/plugin/social.py Wed Jun 17 09:59:18 2015 +0200
@@ -94,7 +94,7 @@
title = FieldProperty(ISocialUsersFolderPlugin['title'])
enabled = FieldProperty(ISocialUsersFolderPlugin['enabled'])
- def get_principal(self, principal_id):
+ def get_principal(self, principal_id, info=True):
if not self.enabled:
return None
if not principal_id.startswith(self.prefix + ':'):
@@ -102,9 +102,12 @@
prefix, login = principal_id.split(':', 1)
user = self.get(login)
if user is not None:
- return PrincipalInfo(id='{prefix}:{user_id}'.format(prefix=self.prefix,
- user_id=user.user_id),
- title=user.title)
+ if info:
+ return PrincipalInfo(id='{prefix}:{user_id}'.format(prefix=self.prefix,
+ user_id=user.user_id),
+ title=user.title)
+ else:
+ return user
def get_all_principals(self, principal_id):
if not self.enabled: