Commit 00578f52 authored by Stefan H. Holek's avatar Stefan H. Holek

Clarify getUserById as discussed on zope-dev.

parent 9f472ef9
......@@ -488,16 +488,15 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
"""Return the named user object or None"""
raise NotImplementedError
def getUserById(self, id, default=_marker):
def getUserById(self, id, default=None):
"""Return the user corresponding to the given id.
"""
# The connection between getting by ID and by name is not a strong
# one
try:
return self.getUser(id)
except:
if default is _marker: raise
user = self.getUser(id)
if user is None:
return default
return user
def _doAddUser(self, name, password, roles, domains, **kw):
"""Create a new user. This should be implemented by subclasses to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment