[Zope3-checkins] CVS: Zope3/src/zope/app/services/pluggableauth - __init__.py:1.18

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Mar 8 07:06:51 EST 2004


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

Modified Files:
	__init__.py 
Log Message:


Adjusted code to use the new APIs for permissions and principals. Also, use
the utility service instead of the permission registry to look up permissions.




=== Zope3/src/zope/app/services/pluggableauth/__init__.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/services/pluggableauth/__init__.py:1.17	Sat Mar  6 12:48:54 2004
+++ Zope3/src/zope/app/services/pluggableauth/__init__.py	Mon Mar  8 07:06:19 2004
@@ -21,6 +21,7 @@
 import random
 import zope.schema
 
+from warnings import warn
 from persistent import Persistent
 from BTrees.IOBTree import IOBTree
 from BTrees.OIBTree import OIBTree
@@ -45,7 +46,7 @@
 
 from zope.app.services.servicenames import Authentication
 from zope.app.interfaces.services.pluggableauth import IUserSchemafied
-from zope.app.interfaces.security import ILoginPassword
+from zope.app.security.interfaces import ILoginPassword
 from zope.app.interfaces.services.pluggableauth \
      import IPluggableAuthenticationService
 from zope.app.interfaces.services.pluggableauth import \
@@ -496,24 +497,30 @@
     implements(IUserSchemafied, IBTreePrincipalSourceContained)
 
     def __init__(self, login, password, title='', description=''):
-        self.id = ''
+        self._id = ''
         self.login = login
         self.password = password
         self.title = title
         self.description = description
 
-    def getId(self):
-        """See IPrincipal."""
+    def _getId(self):
         source = self.__parent__
         auth = source.__parent__
-        return "%s\t%s\t%s" %(auth.earmark, source.__name__, self.id)
+        return "%s\t%s\t%s" %(auth.earmark, source.__name__, self._id)
+
+    def _setId(self, id):
+        self._id = id
+
+    id = property(_getId, _setId)
 
     def getTitle(self):
-        """ See IPrincipal. """
+        warn("Use principal.title instead of principal.getTitle().",
+             DeprecationWarning, 2)
         return self.title
 
     def getDescription(self):
-        """See IPrincipal."""
+        warn("Use principal.description instead of principal.getDescription().",
+             DeprecationWarning, 2)
         return self.description
 
     def getLogin(self):




More information about the Zope3-Checkins mailing list