[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/versioncontrol/README.txt
Changed to take advantage of zope.security.testing
Jim Fulton
jim at zope.com
Thu May 26 11:22:24 EDT 2005
Log message for revision 30511:
Changed to take advantage of zope.security.testing
Changed:
U Zope3/trunk/src/zope/app/versioncontrol/README.txt
-=-
Modified: Zope3/trunk/src/zope/app/versioncontrol/README.txt
===================================================================
--- Zope3/trunk/src/zope/app/versioncontrol/README.txt 2005-05-26 15:21:02 UTC (rev 30510)
+++ Zope3/trunk/src/zope/app/versioncontrol/README.txt 2005-05-26 15:21:54 UTC (rev 30511)
@@ -118,25 +118,12 @@
In order to actually use version control, there must be an
interaction. This is needed to allow the framework to determine the
-user making changes. Let's set up an interaction now. First we need a
-principal. For our purposes, a principal just needs to have an id:
+user making changes. Let's set up an interaction now.
- >>> class FauxPrincipal:
- ... def __init__(self, id):
- ... self.id = id
- >>> principal = FauxPrincipal('bob')
+ >>> import zope.security.testing
+ >>> principal = zope.security.testing.Principal('bob')
+ >>> participation = zope.security.testing.Participation(principal)
-Then we need to define an participation for the principal in the
-interaction:
-
- >>> class FauxParticipation:
- ... interaction=None
- ... def __init__(self, principal):
- ... self.principal = principal
- >>> participation = FauxParticipation(principal)
-
-Finally, we can create the interaction:
-
>>> import zope.security.management
>>> zope.security.management.newInteraction(participation)
More information about the Zope3-Checkins
mailing list