[Zope] Instance from my Zclass have permission problem

Terry terry@taipeitimes.com
Mon, 18 Mar 2002 12:12:09 +0800


Dear list,

I create a product form WMI, and have a Python to call ZSQL Method 
Inside methods folder.
But I can call the Python Script  when I am in this Zclass folder, but 
couldn't call it from the Instance which inherited from this Zclass.
I did anything wrong ?
Thanks for any reply :o)

##### Python Script in My Zclass folder
# Update the data to database
# id: update_to_db
#request = container.REQUEST
#RESPONSE =  request.RESPONSE
print container.absolute_url()
print container['sql_Update']
return printed

#### ZSQL Method in My Zclass folder
# id : sql_Update
#### The method just for test

UPDATE tt_hold_ar SET
ar_head='Permission' WHERE
ar_id='0000114415'

## The result when I call update_to_db in the Zclass folder

<SQL instance at 8cd88a0>


## The result when I call update_to_db from inherited instance, Zope 
just logout me !  ?_?


<!--
Traceback (innermost last):
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 150, in publish_module
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 114, in publish
  File /usr/lib/zope/lib/python/Zope/__init__.py, line 158, in zpublisher_exception_hook
    (Object: 0000114415)
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 98, in publish
  File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 88, in mapply
    (Object: update_to_db)
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 39, in call_object
    (Object: update_to_db)
  File /usr/lib/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 252, in __call__
    (Object: update_to_db)
  File /usr/lib/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 283, in _bindAndExec
    (Object: update_to_db)
  File /usr/lib/zope/lib/python/Products/PythonScripts/PythonScript.py, line 291, in _exec
    (Object: update_to_db)
    (Info: ({'script': &lt;PythonScript instance at 8d03ea0&gt;, 'context': &lt;TTNews instance at 8cade68&gt;, 'container': &lt;TTNews instance at 8cade68&gt;, '_': &lt;TemplateDict object at 0x8d3b970&gt;, 'traverse_subpath': []}, (), {}, None))
  File Script (Python), line 18, in update_to_db
  File /usr/lib/zope/lib/python/AccessControl/ZopeGuards.py, line 94, in guarded_getitem
    (Object: 0000114415)
Unauthorized: (see above)

-->


Best Regard,


Terry