[Zope3-checkins] CVS: Zope3/src/zope/app/security/tests - test_zopepolicy.py:1.13.22.1

Jim Fulton jim at zope.com
Tue Sep 2 18:41:10 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/security/tests
In directory cvs.zope.org:/tmp/cvs-serv26498/src/zope/app/security/tests

Modified Files:
      Tag: user-preferences-branch
	test_zopepolicy.py 
Log Message:
Checking in some work (on a branch) that Staphan and I did toward
implementing user preferences.  More work is needed to finish this up.
Detailed log messages need to be provided in the merge.


=== Zope3/src/zope/app/security/tests/test_zopepolicy.py 1.13 => 1.13.22.1 ===
--- Zope3/src/zope/app/security/tests/test_zopepolicy.py:1.13	Sat Jun  7 01:46:06 2003
+++ Zope3/src/zope/app/security/tests/test_zopepolicy.py	Tue Sep  2 17:40:39 2003
@@ -86,11 +86,11 @@
                        AttributeAnnotations)
 
         # set up some principals
-        self.jim = principalRegistry.definePrincipal('jim', 'Jim', 'Jim Fulton',
-                                                     'jim', '123')
+        self.jim = principalRegistry.definePrincipal(
+            'jim', 'Jim', 'Jim Fulton', 'jim', '123')
 
-        self.tim = principalRegistry.definePrincipal('tim', 'Tim', 'Tim Peters',
-                                                     'tim', '456')
+        self.tim = principalRegistry.definePrincipal(
+            'tim', 'Tim', 'Tim Peters', 'tim', '456')
 
         self.unknown = principalRegistry.defineDefaultPrincipal('unknown',
                     'Unknown', 'Nothing is known about this principal')
@@ -309,6 +309,16 @@
 
         self.__assertPermissions(self.tim, ['read', 'write'], ob)
 
+    def test_principals_can_manage_themselves(self):
+        mp = permissionRegistry.definePermission(
+            'zope.ManagePrincipals', 'Manage principals', '')
+        mp = mp.getId()
+        self.failIf(self.policy.checkPermission(
+            mp, self.jim, Context(self.tim)))
+        self.assert_(self.policy.checkPermission(
+            mp, self.tim, Context(self.tim)))
+
+        
 
 class ITest(IAttributeAnnotatable):
     pass




More information about the Zope3-Checkins mailing list