[Zope] New class, no access to manage_propertiesForm etc.
Winterflood, Jonathan
jonathan.winterflood at capgemini.com
Tue Jun 26 09:37:28 EDT 2007
Hi,
I have created a new class in my product, but I can't access the
PropertyManager pages for it:
import Persistence
from OFS.PropertyManager import PropertyManager
# Zope security infrastructure
from Globals import InitializeClass
from AccessControl import ClassSecurityInfo
class MyClass(Persistence.Persistent,PropertyManager):
"""
L'objet d'interfacage
"""
# Properties are default are persistent typed attributes with
builtin form
# management in the ZMI
_properties = (
{'id':'remote_email', 'type':'string', 'mode': 'w'},
{'id':'local_email', 'type':'string', 'mode': 'w'},
)
# default values
remote_email = ''
local_email = ''
# Tabs that are displayed in the ZMI (inherited from the base
classes)
manage_options = (PropertyManager.manage_options)
# Let me see those pages
__ac_permissions__=(('Manage properties', ('manage_addProperty',
'manage_editProperties',
'manage_delProperties',
'manage_changeProperties',
'manage_propertiesForm',
'manage_propertyTypeForm',
'manage_changePropertyTypes',
)
))
def __init__(self):
pass
security = ClassSecurityInfo()
security.declarePublic('show')
def show(self):
return str(self)
InitializeClass(MyClass)
An instance of this class is held as an attribute of a tool in the
product.
class DBRTool(UniqueObject, SimpleItem, ActionProviderBase,
PropertyManager):
"""Tool for some logic of the DBR site"""
def __init__(self):
# interfacage
self.myInstance = MyClass()
Accessing http://.../portal_dbrtool/myInstance shows str(myInstance),
but http://.../portal_dbrtool/myInstance/manage_propertiesForm
<http://.../portal_dbrtool/myInstance/manage_propertiesForm> shows "You
are not authorized to access this resource." After a login that cannot
be satisfied.
The manage_options and __ac_permissions__ are set according to the
instructions in PropertyManager.
Where am I going wrong? How can I access these pages?
TIA,
Jonathan
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20070626/79fe2c4d/attachment.htm
More information about the Zope
mailing list