[Checkins] SVN: PluggableAuthService/trunk/ Add support for property plugins returning an IPropertySheet to PropertiedUser

Wichert Akkerman wichert at wiggy.net
Tue Jun 12 16:18:02 EDT 2007


Log message for revision 76647:
  Add support for property plugins returning an IPropertySheet to PropertiedUser

Changed:
  U   PluggableAuthService/trunk/PropertiedUser.py
  U   PluggableAuthService/trunk/doc/CHANGES.txt
  U   PluggableAuthService/trunk/interfaces/authservice.py
  U   PluggableAuthService/trunk/interfaces/plugins.py

-=-
Modified: PluggableAuthService/trunk/PropertiedUser.py
===================================================================
--- PluggableAuthService/trunk/PropertiedUser.py	2007-06-12 18:48:21 UTC (rev 76646)
+++ PluggableAuthService/trunk/PropertiedUser.py	2007-06-12 20:18:02 UTC (rev 76647)
@@ -24,6 +24,8 @@
 from interfaces.authservice import IPropertiedUser
 from UserPropertySheet import UserPropertySheet
 from utils import classImplements
+from Products.PluggableAuthService.interfaces.propertysheets \
+    import IPropertySheet
 
 class PropertiedUser( BasicUser ):
 
@@ -282,7 +284,10 @@
         if self._propertysheets.get( id ) is not None:
             raise KeyError, "Duplicate property sheet: %s" % id
 
-        self._propertysheets[ id ] = UserPropertySheet( id, **data )
+        if IPropertySheet.providedBy(data):
+            self._propertysheets[ id ] = data
+        else:
+            self._propertysheets[ id ] = UserPropertySheet( id, **data )
 
 
 classImplements( PropertiedUser,

Modified: PluggableAuthService/trunk/doc/CHANGES.txt
===================================================================
--- PluggableAuthService/trunk/doc/CHANGES.txt	2007-06-12 18:48:21 UTC (rev 76646)
+++ PluggableAuthService/trunk/doc/CHANGES.txt	2007-06-12 20:18:02 UTC (rev 76647)
@@ -4,6 +4,9 @@
 
     Features Added
 
+      - Add support for property plugins returning an IPropertySheet
+        to PropertiedUser. Added addPropertysheet to the IPropertiedUser.
+
       - Added a method to the IRoleAssignerPlugin to remove roles from a
         principal, and an implementation for it on the ZODBRoleManager.
         (http://www.zope.org/Collectors/PAS/57)

Modified: PluggableAuthService/trunk/interfaces/authservice.py
===================================================================
--- PluggableAuthService/trunk/interfaces/authservice.py	2007-06-12 18:48:21 UTC (rev 76646)
+++ PluggableAuthService/trunk/interfaces/authservice.py	2007-06-12 20:18:02 UTC (rev 76647)
@@ -75,6 +75,13 @@
         to objects implementing IPropertySheet
     """
 
+    def addPropertysheet( id, data ):
+        
+        """ Add a new property sheet to the user.
+
+        The property sheet has to be a map or an IPropertySheet instance.
+        """
+
     def listPropertysheets():
 
         """ Return a sequence of property sheet ids

Modified: PluggableAuthService/trunk/interfaces/plugins.py
===================================================================
--- PluggableAuthService/trunk/interfaces/plugins.py	2007-06-12 18:48:21 UTC (rev 76646)
+++ PluggableAuthService/trunk/interfaces/plugins.py	2007-06-12 20:18:02 UTC (rev 76647)
@@ -221,6 +221,9 @@
 
         o User will implement IPropertiedUser.
 
+        o Plugin should return a dictionary or an object providing
+          IPropertiesPlugin.
+
         o Plugin may scribble on the user, if needed (but must still
           return a mapping, even if empty).
 



More information about the Checkins mailing list