# HG changeset patch # User Thierry Florac # Date 1425133682 -3600 # Node ID c9cf6a49501fac0ae5b8d1e7d3ac5b8d7e8d759c # Parent 22f742b01ece0ac81faa358a2ff3ee8b38bf901d Added principal attributes diff -r 22f742b01ece -r c9cf6a49501f src/pyams_security/principal.py --- a/src/pyams_security/principal.py Sat Feb 28 15:26:58 2015 +0100 +++ b/src/pyams_security/principal.py Sat Feb 28 15:28:02 2015 +0100 @@ -31,11 +31,12 @@ id = FieldProperty(IPrincipalInfo['id']) title = FieldProperty(IPrincipalInfo['title']) - groups = FieldProperty(IPrincipalInfo['groups']) + attributes = FieldProperty(IPrincipalInfo['attributes']) def __init__(self, **kwargs): - self.id = kwargs.get('id') - self.title = kwargs.get('title') + self.id = kwargs.pop('id') + self.title = kwargs.pop('title', '__unknown__') + self.attributes = kwargs def __eq__(self, other): return isinstance(other, PrincipalInfo) and (self.id == other.id) @@ -69,7 +70,7 @@ @property def title(self): - return 'MissingPrincipal: {0}'.format(self.id) + return 'MissingPrincipal: {id}'.format(id=self.id) def __eq__(self, other): return isinstance(other, PrincipalInfo) and (self.id == other.id)