[Zope3-checkins] CVS: Zope3/src/zope/app/services/pluggableauth - __init__.py:1.4 configure.zcml:1.3

Stephan Richter srichter@cosmos.phy.tufts.edu
Thu, 3 Jul 2003 17:45:34 -0400


Update of /cvs-repository/Zope3/src/zope/app/services/pluggableauth
In directory cvs.zope.org:/tmp/cvs-serv24319/src/zope/app/services/pluggableauth

Modified Files:
	__init__.py configure.zcml 
Log Message:
- Got rid of IWritePrincipalSource interface and IReadPrincipalSource to
  become IPrincipalSource (based on Jim's IRC request)

- Then I noticed that some browser directives assumed that IPrincipalSource
  objects are automatically are IContainers, which is of course not true.
  So I added a IContainerPrincipalSource marker interface for principal
  sources that are containers (this way we can reuse the container screens).


=== Zope3/src/zope/app/services/pluggableauth/__init__.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/services/pluggableauth/__init__.py:1.3	Mon Jun 23 22:34:29 2003
+++ Zope3/src/zope/app/services/pluggableauth/__init__.py	Thu Jul  3 17:45:30 2003
@@ -40,9 +40,8 @@
 from zope.app.interfaces.security import ILoginPassword
 from zope.app.interfaces.services.pluggableauth \
      import IPluggableAuthenticationService
-from zope.app.interfaces.services.pluggableauth import IPrincipalSource
-from zope.app.interfaces.services.pluggableauth import IReadPrincipalSource,\
-     ILoginPasswordPrincipalSource, IWritePrincipalSource
+from zope.app.interfaces.services.pluggableauth import IPrincipalSource, \
+     ILoginPasswordPrincipalSource, IContainerPrincipalSource
 from zope.app.interfaces.services.service import ISimpleService
 from zope.app.component.nextservice import queryNextService
 from zope.app import zapi
@@ -132,6 +131,7 @@
         dereferenceable.
 
         """
+
         next = None
         
         try:
@@ -181,8 +181,8 @@
         ['simple', 'not_quite_so_simple']
         """
 
-        if not IReadPrincipalSource.isImplementedBy(principal_source):
-            raise TypeError("Source must implement IReadPrincipalSource")
+        if not IPrincipalSource.isImplementedBy(principal_source):
+            raise TypeError("Source must implement IPrincipalSource")
         self.setObject(id, principal_source)
         
     def removePrincipalSource(self, id):
@@ -207,7 +207,7 @@
 class BTreePrincipalSource(Persistent):
     """An efficient, scalable provider of Authentication Principals."""
 
-    implements(ILoginPasswordPrincipalSource, IPrincipalSource,
+    implements(ILoginPasswordPrincipalSource, IContainerPrincipalSource,
                IContainerNamesContainer)
 
     def __init__(self):
@@ -391,7 +391,7 @@
     # PrincipalSource-related methods
 
     def getPrincipal(self, id):
-        """ See IReadPrincipalSource.
+        """ See IPrincipalSource.
 
         'id' is the id as returned by principal.getId(),
         not a login.
@@ -407,7 +407,7 @@
             raise NotFoundError, id
 
     def getPrincipals(self, name):
-        """ See IReadPrincipalSource.
+        """ See IPrincipalSource.
 
         >>> sps = BTreePrincipalSource()
         >>> prin1 = SimplePrincipal('gandalf', 'shadowfax')


=== Zope3/src/zope/app/services/pluggableauth/configure.zcml 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/pluggableauth/configure.zcml:1.2	Mon Jun 23 18:46:17 2003
+++ Zope3/src/zope/app/services/pluggableauth/configure.zcml	Thu Jul  3 17:45:30 2003
@@ -40,14 +40,8 @@
         permission="zope.ManageServices"
         interface="zope.app.interfaces.container.IWriteContainer"
         />
-    <require
-        permission="zope.ManageServices"
-        interface="
-  zope.app.interfaces.services.pluggableauth.IWritePrincipalSource"
-        />
     <allow
-        interface="
-  zope.app.interfaces.services.pluggableauth.IReadPrincipalSource"
+        interface="zope.app.interfaces.services.pluggableauth.IPrincipalSource"
         />
 </content>