RE: [Zope] Product creation difficulty
argh! doing it the way i'm supposed to? i don't have time for that! i've got perfectly good banging my head against a wall while ignoring the door right next to me to do! thanks again for the help :). -Original Message- From: Chris Withers [mailto:[EMAIL PROTECTED] Sent: Friday, April 08, 2005 2:45 AM To: Pete Taylor Cc: 'zope@zope.org' Subject: Re: [Zope] Product creation difficulty Pete Taylor wrote: Error Type: Fault Error Value: Fault 1: 'exceptions.Exception:method echo.__roles__.__contains__ is not supported' Yeah, that's Zope's security mechanisms kicking in. Don't use a python script for this code. Remove your allow_module anduse an external method, like you're supposed to ;-) Either that, or build a python product to do what you want, or use the one that Michael pointed to :-) cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk CONFIDENTIAL NOTICE: This email including any attachments, contains confidential information belonging to the sender. It may also be privileged or otherwise protected by work product immunity or other legal rules. This information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this emailed information is strictly prohibited. If you have received this email in error, please immediately notify us by reply email of the error and then delete this email immediately. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Product creation difficulty
*grin* true enough. at its simplest level, I've been trying to just import xmlrpclib and use it normally in scripts. I used my __init__.py to allow_module('xmlrpclib'), which has stopped it from throwing security errors. however, when I actually run a test script, I get the following: Error Type: Fault Error Value: Fault 1: 'exceptions.Exception:method echo.__roles__.__contains__ is not supported' error_log has this traceback: Traceback (innermost last): Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Shared.DC.Scripts.Bindings, line 306, in __call__ Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module Products.PythonScripts.PythonScript, line 323, in _exec Module None, line 5, in testXRPC - PythonScript at /pro4/testXRPC - Line 5 Module xmlrpclib, line 1029, in __call__ Module xmlrpclib, line 1316, in __request Module xmlrpclib, line 1080, in request Module xmlrpclib, line 1219, in _parse_response Module xmlrpclib, line 742, in close Fault: Fault 1: 'exceptions.Exception:method echo.__roles__.__contains__ is not supported' I can watch the POST /RPC2 messages increment on my xml-rpc server, so I know the message is getting through. but the xmlrpc server isn't built with Zope in mind, so __roles__.__contains__ makes it cough a Fault back at me. the code I have in the python script is as simple as: code import xmlrpclib server = xmlrpclib.ServerProxy(http://localhost:;) server.echo('this is a test') /code echo just sends the recieved string back. it works from command line, but that's not surprising... I could be wrong about where or how it's failing, but the traceback looks like the message is getting there, and returning with the echo method having been wrapped in a zope security check, thus faulting at the server... Thanks for any help... this list is the best I've participated in. You guys are awesome. -Original Message- From: Chris Withers [mailto:[EMAIL PROTECTED] Sent: Thursday, April 07, 2005 8:35 AM To: Pete Taylor; zope@zope.org Subject: Re: [Zope] Product creation difficulty (keep replies on the list, more people can help that way) Pete Taylor wrote: thanks man. doing it that way has cleared up the security problem. i've run into others trying to access xml-rpc methods remotely (zope keeps passing the __roles__ checks back to the xmlrpc server, which says i don't know what you're talking about, etc) You'd have to give us more information if you want help with that, it sounds like something bizarre is happening that shouldn't ;-) cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk CONFIDENTIAL NOTICE: This email including any attachments, contains confidential information belonging to the sender. It may also be privileged or otherwise protected by work product immunity or other legal rules. This information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this emailed information is strictly prohibited. If you have received this email in error, please immediately notify us by reply email of the error and then delete this email immediately. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Product creation difficulty
Does anyone have a recommendation for a Product creation guide/tutorial they've used and made work, preferably one with examples and explanations of _ac_permissions? I've tried three or four, all of which work after a fashion... I have a very simple class that I've been using to test product creation. It's basically just an xmlrpc connection returned as a class instance (which serves no real purpose currently since importing xmlrpclib isn't exactly difficult to do in a method). I've logged in as my admin user, so rights to the site shouldn't be a problem, which makes me think it's got to be security in the module itself that i'm not establishing correctly. The problem is that every time I actually try to instantiate an instance of the class and make use of the object's methods, I get the following traceback: Traceback (innermost last): Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Shared.DC.Scripts.Bindings, line 306, in __call__ Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module Products.PythonScripts.PythonScript, line 323, in _exec Module None, line 1, in testrpc - PythonScript at /pro4/testrpc - Line 1 Module AccessControl.ZopeGuards, line 237, in guarded_import Module AccessControl.ZopeGuards, line 300, in load_module Unauthorized: You are not allowed to access 'XMLRPCClient' in this context I'd be more than happy to copy in blocks of code if it seems like it will help, but all things considered, I'd be happier just to know where best to look. I've looked at the ZDG, the Zope Book 2.7, and a number of Python Product Creation tutorials... but since they're all geared toward getting a product to initialize and such (which works great), and it's a security error I'm getting, I don't really know where to go next. Thanks all, Pete Taylor THIG Systems (desk) 352.333.1722 (cell) 352.359.0073 CONFIDENTIAL NOTICE: This email including any attachments, contains confidential information belonging to the sender. It may also be privileged or otherwise protected by work product immunity or other legal rules. This information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this emailed information is strictly prohibited. If you have received this email in error, please immediately notify us by reply email of the error and then delete this email immediately. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )