Commit 619712ad authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Set declarative securities and solve some inheritance conflicts

parent 37b80134
...@@ -55,7 +55,20 @@ class ERP5Catalog(Folder, Catalog): ...@@ -55,7 +55,20 @@ class ERP5Catalog(Folder, Catalog):
allowed_types = () allowed_types = ()
#TODO(low priority): Add an icon to display at ERP5 Zope interface #TODO(low priority): Add an icon to display at ERP5 Zope interface
icon = None icon = None
# Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
security.declareProtected(Permissions.ManagePortal,
'manage_editProperties',
'manage_changeProperties',
'manage_propertiesForm',
)
#_properties = Catalog._properties
#_propertyMap = Catalog._propertyMap
#_setPropValue = Catalog._setPropValue
#getProperty = Catalog.getProperty
manage_options = ( Folder.manage_options+ manage_options = ( Folder.manage_options+
OFS.History.Historical.manage_options OFS.History.Historical.manage_options
...@@ -65,14 +78,10 @@ class ERP5Catalog(Folder, Catalog): ...@@ -65,14 +78,10 @@ class ERP5Catalog(Folder, Catalog):
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.SimpleItem , PropertySheet.SimpleItem
, PropertySheet.Folder , PropertySheet.Folder
, PropertySheet.CategoryCore
, PropertySheet.Catalog , PropertySheet.Catalog
) )
_properties = Catalog._properties
_propertyMap = Catalog._propertyMap
_setPropValue = Catalog._setPropValue
getProperty = Catalog.getProperty
# Declarative Constructors # Declarative Constructors
constructors = (manage_addERP5CatalogForm, manage_addERP5Catalog,) constructors = (manage_addERP5CatalogForm, manage_addERP5Catalog,)
...@@ -93,6 +102,9 @@ class ERP5Catalog(Folder, Catalog): ...@@ -93,6 +102,9 @@ class ERP5Catalog(Folder, Catalog):
meta_types.append(meta_type) meta_types.append(meta_type)
return meta_types return meta_types
_updateProperty = Catalog._updateProperty
_setPropValue = Catalog._setPropValue
InitializeClass(ERP5Catalog) InitializeClass(ERP5Catalog)
class ERP5CatalogError(CatalogError): pass class ERP5CatalogError(CatalogError): pass
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment