Using unauthorized modules in scripts
Please refer to this Zope specific tutorial.
If you are creating your own product, you can place authorizing to your Product's __init__.py
Here is some example:
from AccessControl import allow_module
from AccessControl import ModuleSecurityInfo
...
ModuleSecurityInfo("Products.Usability").declarePublic("isRequestView")
ModuleSecurityInfo("Products.Usability").declarePublic("issueFieldVisibility")
Then you can call public functions in your page template code:
<a tal:attributes="href python: modules['Products.Usability'].isRequestView(rows.get('link'), context)"
See following Zope methods and classes
- AccessControl.allow_module
- AccessControl.allow_class
- AccessControl.ClassSecurityInfo
- AccessControl.ModuleSecurityInfo
Note that sometimes secured calls should be placed inside wrapper functions which deal with parameter checking and other validation to prevent opening any security holes.
