[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/authentication/groupfolder. Fixed a bug in computation of the id in principalInfo.

Jim Fulton jim at zope.com
Thu Mar 31 15:27:59 EST 2005


Log message for revision 29763:
  Fixed a bug in computation of the id in principalInfo.
  

Changed:
  U   Zope3/trunk/src/zope/app/authentication/groupfolder.py
  U   Zope3/trunk/src/zope/app/authentication/groupfolder.txt

-=-
Modified: Zope3/trunk/src/zope/app/authentication/groupfolder.py
===================================================================
--- Zope3/trunk/src/zope/app/authentication/groupfolder.py	2005-03-31 19:56:06 UTC (rev 29762)
+++ Zope3/trunk/src/zope/app/authentication/groupfolder.py	2005-03-31 20:27:58 UTC (rev 29763)
@@ -168,8 +168,8 @@
             id = id[len(self.prefix):]
             info = self.get(id)
             if info is not None:
-                return principalfolder.PrincipalInfo(id, info.title,
-                                                     info.description)
+                return principalfolder.PrincipalInfo(
+                    self.prefix+id, info.title, info.description)
 
 class GroupCycle(Exception):
     """There is a cyclic relationship among groups

Modified: Zope3/trunk/src/zope/app/authentication/groupfolder.txt
===================================================================
--- Zope3/trunk/src/zope/app/authentication/groupfolder.txt	2005-03-31 19:56:06 UTC (rev 29762)
+++ Zope3/trunk/src/zope/app/authentication/groupfolder.txt	2005-03-31 20:27:58 UTC (rev 29763)
@@ -63,7 +63,7 @@
   ...             info = self.groups.principalInfo(id)
   ...             if info is None:
   ...                return None
-  ...         principal = Principal(id, info.title, info.description)
+  ...         principal = Principal(info.id, info.title, info.description)
   ...         setGroupsForPrincipal(PrincipalCreatedEvent(principal))
   ...         return principal
 
@@ -192,6 +192,9 @@
 Of course, this applies to groups too:
 
   >>> principal = principals.getPrincipal('group.G1')
+  >>> principal.id
+  'group.G1'
+  
   >>> principal.groups
   [u'group.G2']
 



More information about the Zope3-Checkins mailing list