[Zope3-checkins] SVN: Zope3/trunk/ Backed out `removePrincipal` -- needs more discussion.

Garrett Smith garrett at mojave-corp.com
Fri Mar 11 20:23:13 EST 2005


Log message for revision 29453:
  Backed out `removePrincipal` -- needs more discussion.

Changed:
  U   Zope3/trunk/doc/CHANGES.txt
  U   Zope3/trunk/src/zope/app/security/principalregistry.py
  U   Zope3/trunk/src/zope/app/security/tests/test_principalregistry.py

-=-
Modified: Zope3/trunk/doc/CHANGES.txt
===================================================================
--- Zope3/trunk/doc/CHANGES.txt	2005-03-12 01:18:32 UTC (rev 29452)
+++ Zope3/trunk/doc/CHANGES.txt	2005-03-12 01:23:13 UTC (rev 29453)
@@ -9,7 +9,7 @@
   Some future release (Zope X3 3.1.0)
 
     New features
-
+    
       - zope.app.form.utility setUpEditWidgets, when given a source
         that is security proxied and asked to set up edit widgets
         for fields that will raise Unauthorized when set, now raises
@@ -24,9 +24,9 @@
 
         Added a layer argument to the menu directives and made sure that all
         browser directives specify the layer for the menu directives.
+    
+      - Implemented issue 292: Add factory to browser:resource directive 
 
-      - Implemented issue 292: Add factory to browser:resource directive
-
       - Implemented issue 309: <schemadisplay> should support <widget>
 
       - Developed a generic browser:form directive. It is pretty much the same
@@ -34,7 +34,7 @@
         on some context or adapted context but sent as a dictionary to special
         method (by default). By default these methods are named `getData()` and
         `setData(data)`.
-
+ 
       - When raising the Unauthorized exception, the security checker
         now passes the object in question in addition to the attribute
         name and missing permission.  This should make debugging easier.
@@ -301,11 +301,6 @@
         zope.app.container.constraints.containers) that greatly simplify
         expressing containment constraints.
 
-      - Added `removePrincipal` to the principal registry. The applications for
-        this are pretty limited, but it can be used to replace a ZCML-defined
-        principal in the event its login or password has changed (e.g. when
-        using a GUI management tool, etc.)
-
     Restructuring
 
       - Applied changes suggested in issue 339: Improvements to generated forms
@@ -323,7 +318,7 @@
 
         Deprecated `zope:defaultView` directive and removed unused default
         view handler in `zope.app.publisher.browser.viewmeta`. Added a `layer`
-        attribute to the `browser:defaultView` directive.
+        attribute to the `browser:defaultView` directive. 
 
       - zope.component.createObject no longer accepts a positional
         context argument.  A context can be provided as a keyword argument.
@@ -508,20 +503,24 @@
         Instead of `rename(container, oldName, newName)`, one should use
         `IContainerItemRenamer(container).renameItem(oldName, newName)`.
 
+      - Moved site-specific security policy configuration into
+        securitypolicy.zcml. If you want to change the default security policy
+        for a Zope instance, you can modify this file in your etc directory.
+
     Bug Fixes
 
-      - Fixed issue #345: Using response.write should not involve unicode
+      - Fixed issue #345: Using response.write should not involve unicode 
                           conversion
 
       - Fixed issue #371: OrderedMultiSelectWidget ignores setRenderedValue
 
       - Fixed issue #360: MultiSelectWidget configured for ISet but creates
                           list
-
+                          
         The correct type of the collection field is now discovered and used.
 
-      - Addressed issue #348: ZCML hides import errors
-
+      - Addressed issue #348: ZCML hides import errors 
+ 
         I tried really hard to get a better error message, but it is not
         possible, so I just prepended "ImportError:" to the error message.
 

Modified: Zope3/trunk/src/zope/app/security/principalregistry.py
===================================================================
--- Zope3/trunk/src/zope/app/security/principalregistry.py	2005-03-12 01:18:32 UTC (rev 29452)
+++ Zope3/trunk/src/zope/app/security/principalregistry.py	2005-03-12 01:23:13 UTC (rev 29453)
@@ -106,11 +106,6 @@
 
         return p
 
-    def removePrincipal(self, id):
-        p = self.__principalsById[id]
-        del self.__principalsById[id]
-        del self.__principalsByLogin[p.getLogin()]
-
     def registerGroup(self, group):
         id = group.id
         if id in self.__principalsById or id == self.__defaultid:
@@ -172,4 +167,4 @@
 class EverybodyGroup(Group):
 
     implements(interfaces.IEveryoneGroup)
-
+    

Modified: Zope3/trunk/src/zope/app/security/tests/test_principalregistry.py
===================================================================
--- Zope3/trunk/src/zope/app/security/tests/test_principalregistry.py	2005-03-12 01:18:32 UTC (rev 29452)
+++ Zope3/trunk/src/zope/app/security/tests/test_principalregistry.py	2005-03-12 01:23:13 UTC (rev 29453)
@@ -147,25 +147,7 @@
         self.assertRaises(DuplicateId, self.reg.definePrincipal,
                           "anybody", "title")
 
-    def testRemovePrincipal(self):
-        p = self.reg.definePrincipal('3', 'Frank', 'Frank Popp', 'frank', '321')
-        self.assert_(p is self.reg.getPrincipal('3'))
-        self.assert_(p is self.reg.getPrincipalByLogin('frank'))
-        self.reg.removePrincipal('3')
-        try:
-            self.reg.getPrincipal('3')
-        except KeyError:
-            pass
-        else:
-            self.fail()
-        try:
-            self.reg.getPrincipalByLogin('frank')
-        except KeyError:
-            pass
-        else:
-            self.fail()
 
-
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(Test),



More information about the Zope3-Checkins mailing list