[ZPT] Security with PageTemplateFile

Evan Simpson evan@zope.com
Tue, 04 Dec 2001 16:34:43 -0500


Brent M Hendricks wrote:

> Then in the management page template I have a line like:
> 
> <span tal:replace="here/conf/DEFAULT_HOST_NAME">MyHost</span>
> 
> Unfortunately this give me the error
> 
> Error Type: Undefined
> Error Value: You are not allowed to access DEFAULT_HOST_NAME in this
> context not found in 'here/conf/DEFAULT_HOST_NAME', at line 5, column 9

Since mm_cfg is a module, you could do:

from AccessControl import ModuleSecurityInfo
ModuleSecurityInfo('Mailman').declarePublic('mm_cfg')
ModuleSecurityInfo('Mailman.mm_cfg').setDefaultAccess("allow")

Cheers,

Evan @ Zope