(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)
jim, i was just playing around with it a little and i noticed that if you give the python script a proxy role 'Manager' the code will work and you can successfully user getUserDN. at this point i am not sure why it pops up an authentication box even if the current user does have 'Manager' role. another workaround for right now might be to use an external method. jens On Tuesday, June 26, 2001, at 01:18 , jmr@computing.com wrote:
(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)
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Jens Vagelpohl -
jmr@computing.com