[Checkins] SVN: PluggableAuthService/branches/seattle-sprint/ Cleanup IPropertiedUser handling and allow PAS to use IBasicUser

Wichert Akkerman wichert at wiggy.net
Sat Oct 28 17:10:20 EDT 2006


Log message for revision 70947:
  Cleanup IPropertiedUser handling and allow PAS to use IBasicUser

Changed:
  U   PluggableAuthService/branches/seattle-sprint/PluggableAuthService.py
  U   PluggableAuthService/branches/seattle-sprint/interfaces/authservice.py
  U   PluggableAuthService/branches/seattle-sprint/interfaces/plugins.py

-=-
Modified: PluggableAuthService/branches/seattle-sprint/PluggableAuthService.py
===================================================================
--- PluggableAuthService/branches/seattle-sprint/PluggableAuthService.py	2006-10-28 18:05:17 UTC (rev 70946)
+++ PluggableAuthService/branches/seattle-sprint/PluggableAuthService.py	2006-10-28 21:10:20 UTC (rev 70947)
@@ -58,6 +58,7 @@
 import Products
 
 from interfaces.authservice import IPluggableAuthService
+from interfaces.authservice import IPropertiedUser
 from interfaces.authservice import _noroles
 from interfaces.plugins import IExtractionPlugin
 from interfaces.plugins import ILoginPasswordHostExtractionPlugin
@@ -724,13 +725,14 @@
         if user is None:
 
             user = self._createUser( plugins, user_id, name )
-            propfinders = plugins.listPlugins( IPropertiesPlugin )
+            if IPropertiedUser.isImplementedBy( user ):
+                propfinders = plugins.listPlugins( IPropertiesPlugin )
 
-            for propfinder_id, propfinder in propfinders:
+                for propfinder_id, propfinder in propfinders:
 
-                data = propfinder.getPropertiesForUser( user, request )
-                if data:
-                    user.addPropertysheet( propfinder_id, data )
+                    data = propfinder.getPropertiesForUser( user, request )
+                    if data:
+                        user.addPropertysheet( propfinder_id, data )
 
             groups = self._getGroupsForPrincipal( user, request
                                                 , plugins=plugins )

Modified: PluggableAuthService/branches/seattle-sprint/interfaces/authservice.py
===================================================================
--- PluggableAuthService/branches/seattle-sprint/interfaces/authservice.py	2006-10-28 18:05:17 UTC (rev 70946)
+++ PluggableAuthService/branches/seattle-sprint/interfaces/authservice.py	2006-10-28 21:10:20 UTC (rev 70947)
@@ -75,6 +75,17 @@
         to objects implementing IPropertySheet
     """
 
+    def addPropertysheet( id, data ):
+
+        """ Add a property sheet
+
+        o id is an identifier for the property sheet. If the id is already
+          used a KeyError is raised.
+
+        o data is a IPropertysheet instance
+        """
+
+
     def listPropertysheets():
 
         """ Return a sequence of property sheet ids

Modified: PluggableAuthService/branches/seattle-sprint/interfaces/plugins.py
===================================================================
--- PluggableAuthService/branches/seattle-sprint/interfaces/plugins.py	2006-10-28 18:05:17 UTC (rev 70946)
+++ PluggableAuthService/branches/seattle-sprint/interfaces/plugins.py	2006-10-28 21:10:20 UTC (rev 70947)
@@ -178,7 +178,7 @@
 
 class IUserFactoryPlugin( Interface ):
 
-    """ Create a new IPropertiedUser.
+    """ Create a new IBasicUser.
     """
 
     def createUser( user_id, name ):
@@ -190,7 +190,7 @@
 
 class IAnonymousUserFactoryPlugin( Interface ):
 
-    """ Create a new anonymous IPropertiedUser.
+    """ Create a new anonymous IBasicUser.
     """
 
     def createAnonymousUser():



More information about the Checkins mailing list