[Zope] User Objects?
jmr@computing.com
jmr@computing.com
Mon, 25 Jun 2001 18:18:18 -0500 (CDT)
(In a python script)
What is the difference between the results of these two methods of
getting a user object?
uid = 'jmr'
u_obj = _.SecurityGetUser()
#u_obj = context.acl_users.getUser(uid)
#dn = u_obj.getUserDN()
My experiments show me that either u_obj works with methods such as
getRole, hasRoles, getUserName.
However, only the former version (SecurityGetUser) works for methods
that come from the LDAPLoginadapter (which is the user folder in this
case), such as getUserDN.
Any clues? (I have the Manager role..)
I need to find a way to get a fully functional user object given a
string representation of their userid. (So I can look at and play
with their attributes.)
Thanks!
Jim Rowan
DCSI
jmr@computing.com
(zope 2.3.2; freebsd 4.x; python 1.5.2)
Here's the trace:
<P><STRONG>Unauthorized</STRONG></P>
You are not authorized to access <em>getUserDN</em>.
<!--
Traceback (innermost last):
File /usr/local/share/zope-2.3.2/lib/python/ZPublisher/Publish.py, line 223, in publish_module
File /usr/local/share/zope-2.3.2/lib/python/ZPublisher/Publish.py, line 187, in publish
File /usr/local/share/zope-2.3.2/lib/python/ZPublisher/Publish.py, line 171, in publish
File /usr/local/share/zope-2.3.2/lib/python/ZPublisher/mapply.py, line 160, in mapply
(Object: ldapprops)
File /usr/local/share/zope-2.3.2/lib/python/ZPublisher/Publish.py, line 112, in call_object
(Object: ldapprops)
File /usr/local/share/zope-2.3.2/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__
(Object: ldapprops)
File /usr/local/share/zope-2.3.2/lib/python/Shared/DC/Scripts/Bindings.py, line 354, in _bindAndExec
(Object: ldapprops)
File /usr/local/share/zope-2.3.2/lib/python/Products/PythonScripts/PythonScript.py, line 336, in _exec
(Object: ldapprops)
(Info: ({'script': <PythonScript instance at b099580>, 'context': <Folder instance at b532980>, 'container': <Folder instance at b532980>, '_': <TemplateDict object at ae279c0>, 'traverse_subpath': []}, (), {}, None))
File Script (Python), line 5, in ldapprops
File /usr/local/share/zope-2.3.2/lib/python/Products/PythonScripts/Guarded.py, line 273, in __getattr__
File /usr/local/share/zope-2.3.2/lib/python/Products/PythonScripts/Guarded.py, line 150, in __careful_getattr__
File /usr/local/share/zope-2.3.2/lib/python/AccessControl/SecurityManager.py, line 144, in validate
File /usr/local/share/zope-2.3.2/lib/python/AccessControl/ZopeSecurityPolicy.py, line 225, in validate
Unauthorized: (see above)