[Zope3-checkins] CVS: Zope3/src/zope/app/services - error.py:1.5
principalannotation.py:1.14 servicenames.py:1.17
Stephan Richter
srichter at cosmos.phy.tufts.edu
Mon Mar 8 07:06:50 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv13053/src/zope/app/services
Modified Files:
error.py principalannotation.py servicenames.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/error.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/services/error.py:1.4 Fri Feb 20 11:57:30 2004
+++ Zope3/src/zope/app/services/error.py Mon Mar 8 07:06:10 2004
@@ -17,7 +17,6 @@
$Id$
"""
-
from persistent import Persistent
from random import random
from thread import allocate_lock
@@ -110,9 +109,9 @@
else:
login = 'unauthenticated'
username = ', '.join(map(str, (login,
- request.user.getId(),
- request.user.getTitle(),
- request.user.getDescription()
+ request.user.id,
+ request.user.title,
+ request.user.description
)))
# When there's an unauthorized access, request.user is
# not set, so we get an AttributeError
=== Zope3/src/zope/app/services/principalannotation.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/services/principalannotation.py:1.13 Tue Mar 2 08:40:48 2004
+++ Zope3/src/zope/app/services/principalannotation.py Mon Mar 8 07:06:10 2004
@@ -51,8 +51,7 @@
If there is no IAnnotations it will be created and then returned.
"""
-
- return self.getAnnotationsById(principal.getId())
+ return self.getAnnotationsById(principal.id)
def getAnnotationsById(self, principalId):
"""Return object implementing IAnnotations for the given principal.
@@ -70,7 +69,7 @@
def hasAnnotations(self, principal):
"""Return boolean indicating if given principal has IAnnotations."""
- return principal.getId() in self.annotations
+ return principal.id in self.annotations
class Annotations(Persistent, Location):
@@ -125,4 +124,4 @@
self.service = service
def __call__(self, principal):
- return self.service.getAnnotationsById(principal.getId())
+ return self.service.getAnnotationsById(principal.id)
=== Zope3/src/zope/app/services/servicenames.py 1.16 => 1.17 ===
--- Zope3/src/zope/app/services/servicenames.py:1.16 Wed Mar 3 12:07:10 2004
+++ Zope3/src/zope/app/services/servicenames.py Mon Mar 8 07:06:10 2004
@@ -24,7 +24,6 @@
EventSubscription = 'Subscription'
ErrorLogging = 'ErrorLogging'
HubIds = 'HubIds'
-Permissions = 'Permissions'
PrincipalAnnotation = 'PrincipalAnnotation'
Translation = 'Translation'
Workflows = 'Workflows'
More information about the Zope3-Checkins
mailing list