[Zope-dev] Can't import

Leonardo Rochael Almeida leo@hiper.com.br
22 Jan 2003 19:02:24 -0200


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.