Hi!<br><br>I am trying to execute following code<br><br><i><b>import ZODB<br>from Persistence import Persistent<br><br>class Employee(Persistent):<br><br> def setName(self, name):<br> <a href="http://self.name">self.name</a> = name<br>
</b></i><br>but getting following error<br><br><i><strong>Error Type: ImportError</strong><br><strong>Error Value:
import of "Persistent" from "Persistence" is unauthorized. You are not
allowed to access 'Persistent' in this context</strong></i>
<br><br>this is my full error log<br><br><br><table><tbody><tr><th align="left" valign="top">Time</th>
<td>2009/03/24 22:31:33.559 GMT+0530</td>
</tr>
<tr>
<th align="left" valign="top">User Name (User Id)</th>
<td> admin (admin)</td>
</tr>
<tr>
<th align="left" valign="top">Request URL</th>
<td><a href="http://localhost:9673/DeveloperGuide/Simpleinterface">http://localhost:9673/DeveloperGuide/Simpleinterface</a></td>
</tr>
<tr>
<th align="left" valign="top">Exception Type</th>
<td>ImportError</td>
</tr>
<tr>
<th align="left" valign="top">Exception Value</th>
<td>import of "Persistent" from "Persistence" is unauthorized. You are not allowed to access 'Persistent' in this context</td>
</tr>
</tbody></table>
<div><p>Traceback (innermost last):
</p><ul><li> Module ZPublisher.Publish, line 119, in publish</li><li> Module ZPublisher.mapply, line 88, in mapply</li><li> Module ZPublisher.Publish, line 42, in call_object</li><li> Module Shared.DC.Scripts.Bindings, line 313, in __call__</li>
<li> Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec</li><li> Module Products.PythonScripts.PythonScript, line 327, in _exec</li><li> Module None, line 2, in Simpleinterface<br>
<b><PythonScript at /DeveloperGuide/Simpleinterface></b><br>
<b>Line 2</b></li><li> Module AccessControl.ZopeGuards, line 284, in guarded_import</li></ul>ImportError: import of "Persistent" from "Persistence" is
unauthorized. You are not allowed to access 'Persistent' in this
context
</div>
<p><a href="http://localhost:9673/error_log/getLogEntryAsText?id=1237914093.560.351902229926">Display
traceback as text</a></p>
<p>
</p><form action="manage_main" method="get">
<input name="submit" value=" Return to log " type="submit">
</form>
<h3>REQUEST</h3>
<h3>form</h3><table><tbody><tr align="left" valign="top"><th>-C</th><td>''</td></tr></tbody></table><h3>cookies</h3><table><tbody><tr align="left" valign="top"><th>dtpref_rows</th><td>'20'</td></tr><tr align="left" valign="top">
<th>dtpref_cols</th><td>'90%'</td></tr><tr align="left" valign="top"><th>tree-s</th><td>'eJzT0MgpMOQKVneEA1dbda4CI67EkgJjLj0AeGcHew'</td></tr><tr align="left" valign="top"><th>GLog</th><td>'%7Bleft%3A0%2Ctop%3A0%2Cwidth%3A1175%2Cheight%3A630%2CpriorityDefaults%3A%7BLog%3A4%7D%2CdefaultPriority%3A3%2CtrackRPC%3Anull%7D'</td>
</tr></tbody></table><h3>lazy items</h3><table><tbody><tr align="left" valign="top"><th>SESSION</th><td><bound method SessionDataManager.getSessionData of <SessionDataManager at /session_data_manager>></td></tr>
</tbody></table><h3>other</h3><table><tbody><tr align="left" valign="top"><th>TraversalRequestNameStack</th><td>[]</td></tr><tr align="left" valign="top"><th>AUTHENTICATED_USER</th><td><User 'admin'></td></tr>
<tr align="left" valign="top"><th>URL</th><td>'<a href="http://localhost:9673/DeveloperGuide/Simpleinterface">http://localhost:9673/DeveloperGuide/Simpleinterface</a>'</td></tr><tr align="left" valign="top"><th>SERVER_URL</th>
<td>'<a href="http://localhost:9673">http://localhost:9673</a>'</td></tr><tr align="left" valign="top"><th>AUTHENTICATION_PATH</th><td>''</td></tr><tr align="left" valign="top"><th>traverse_subpath</th><td>
[]</td></tr><tr align="left" valign="top"><th>PUBLISHED</th><td><PythonScript at /DeveloperGuide/Simpleinterface></td></tr><tr align="left" valign="top"><th>ACTUAL_URL</th><td>'<a href="http://localhost:9673/DeveloperGuide/Simpleinterface">http://localhost:9673/DeveloperGuide/Simpleinterface</a>'</td>
</tr><tr align="left" valign="top"><th>URL0</th><td><a href="http://localhost:9673/DeveloperGuide/Simpleinterface">http://localhost:9673/DeveloperGuide/Simpleinterface</a></td></tr><tr align="left" valign="top"><th>URL1</th>
<td><a href="http://localhost:9673/DeveloperGuide">http://localhost:9673/DeveloperGuide</a></td></tr><tr align="left" valign="top"><th>URL2</th><td><a href="http://localhost:9673">http://localhost:9673</a></td></tr><tr align="left" valign="top">
<th>BASE0</th><td><a href="http://localhost:9673">http://localhost:9673</a></td></tr><tr align="left" valign="top"><th>BASE1</th><td><a href="http://localhost:9673">http://localhost:9673</a></td></tr><tr align="left" valign="top">
<th>BASE2</th><td><a href="http://localhost:9673/DeveloperGuide">http://localhost:9673/DeveloperGuide</a></td></tr><tr align="left" valign="top"><th>BASE3</th><td><a href="http://localhost:9673/DeveloperGuide/Simpleinterface">http://localhost:9673/DeveloperGuide/Simpleinterface</a></td>
</tr></tbody></table><h3>environ</h3><table><tbody><tr align="left" valign="top"><th>HTTP_COOKIE</th><td>'dtpref_rows="20";
dtpref_cols="90%";
GLog=%7Bleft%3A0%2Ctop%3A0%2Cwidth%3A1175%2Cheight%3A630%2CpriorityDefaults%3A%7BLog%3A4%7D%2CdefaultPriority%3A3%2CtrackRPC%3Anull%7D;
tree-s="eJzT0MgpMOQKVneEA1dbda4CI67EkgJjLj0AeGcHew"'</td></tr><tr align="left" valign="top"><th>SERVER_SOFTWARE</th><td>'Zope/(Zope 2.10.5-final, python 2.4.5, linux2) ZServer/1.1'</td></tr><tr align="left" valign="top">
<th>SCRIPT_NAME</th><td>''</td></tr><tr align="left" valign="top"><th>REQUEST_METHOD</th><td>'GET'</td></tr><tr align="left" valign="top"><th>PATH_INFO</th><td>'/DeveloperGuide/Simpleinterface'</td>
</tr><tr align="left" valign="top"><th>SERVER_PROTOCOL</th><td>'HTTP/1.1'</td></tr><tr align="left" valign="top"><th>channel.creation_time</th><td>1237914020</td></tr><tr align="left" valign="top"><th>CONNECTION_TYPE</th>
<td>'keep-alive'</td></tr><tr align="left" valign="top"><th>HTTP_ACCEPT_CHARSET</th><td>'ISO-8859-1,utf-8;q=0.7,*;q=0.7'</td></tr><tr align="left" valign="top"><th>HTTP_USER_AGENT</th><td>'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.7) Gecko/2009030422 Ubuntu/8.04 (hardy) Firefox/3.0.7'</td>
</tr><tr align="left" valign="top"><th>HTTP_REFERER</th><td>'<a href="http://localhost:9673/DeveloperGuide/Simpleinterface/ZPythonScriptHTML_editForm">http://localhost:9673/DeveloperGuide/Simpleinterface/ZPythonScriptHTML_editForm</a>'</td>
</tr><tr align="left" valign="top"><th>SERVER_NAME</th><td>'0.0.0.0'</td></tr><tr align="left" valign="top"><th>REMOTE_ADDR</th><td>'127.0.0.1'</td></tr><tr align="left" valign="top"><th>PATH_TRANSLATED</th>
<td>'/DeveloperGuide/Simpleinterface'</td></tr><tr align="left" valign="top"><th>SERVER_PORT</th><td>'9673'</td></tr><tr align="left" valign="top"><th>HTTP_HOST</th><td>'localhost:9673'</td></tr><tr align="left" valign="top">
<th>HTTP_ACCEPT</th><td>'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'</td></tr><tr align="left" valign="top"><th>GATEWAY_INTERFACE</th><td>'CGI/1.1'</td></tr><tr align="left" valign="top">
<th>HTTP_ACCEPT_LANGUAGE</th><td>'en-us,en;q=0.5'</td></tr><tr align="left" valign="top"><th>HTTP_ACCEPT_ENCODING</th><td>'gzip,deflate'</td></tr><tr align="left" valign="top"><th>HTTP_KEEP_ALIVE</th><td>'300'</td>
</tr></tbody></table><br><br><br>I think I have to change permissions, but the question is from WHERE please help me out..<br><br><br>Thanks,<br>Amol<br>