I have a simple python script that tries to do the following: from AccessControl import ClassSecurityInfo And produces the following error: Error Type: ImportError Error Value: import of "ClassSecurityInfo" from "AccessControl" is unauthorized. You are not allowed to access ClassSecurityInfo in this context I think all other from...import statements cause the same. Can anyone tell me what this is caused by, and how to work around it? (Zope 2.6.0 (binary release, python 2.1, linux2-x86), python 2.1.3, linux2) David Cain Senior Web Developer, Information Systems Department Syracuse University Library Syracuse, New York 13244-2010 (315) 443-5923 mailto:dacain@library.syr.edu mailto:dacain@syr.edu
You're doing it wrong David. you can't use declarative security from inside PythonScripts otherwise you'd be able to declare your way into unrestricted code :-) You have to use the security API of the File object itself: fileObject.manage_permission("View", roles=["Manager"], acquire=0) fileObject.manage_permission("Access contents information", roles=["Manager"], acquire=0) On Wed, 2003-01-22 at 17:53, David Cain wrote:
I have a simple python script that tries to do the following: from AccessControl import ClassSecurityInfo
And produces the following error: Error Type: ImportError Error Value: import of "ClassSecurityInfo" from "AccessControl" is unauthorized. You are not allowed to access ClassSecurityInfo in this context
-- Ideas don't stay in some minds very long because they don't like solitary confinement.
participants (2)
-
David Cain -
Leonardo Rochael Almeida