Commit 62b3c370 authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Explicilty add tab and remove useless constructors

parent ad4712c3
...@@ -44,25 +44,6 @@ from zLOG import LOG, INFO, TRACE, WARNING, ERROR ...@@ -44,25 +44,6 @@ from zLOG import LOG, INFO, TRACE, WARNING, ERROR
import time import time
import urllib import urllib
def manage_addERP5Catalog(self, id, title,
vocab_id='create_default_catalog_',
REQUEST=None,
**kw):
"""Add a Catalog object
"""
id = str(id)
title = str(title)
vocab_id = str(vocab_id)
if vocab_id == 'create_default_catalog_':
vocab_id = None
c = ERP5Catalog(id, title, self)
self._setObject(id, c)
c = self._getOb(id)
if REQUEST is not None:
REQUEST['RESPONSE'].redirect( 'manage_main' )
return c
class Filter(object): class Filter(object):
""" """
Class to act as filter object for filterable methods. Class to act as filter object for filterable methods.
...@@ -166,14 +147,17 @@ class ERP5Catalog(Folder, Catalog): ...@@ -166,14 +147,17 @@ class ERP5Catalog(Folder, Catalog):
# Declarative security # Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
security.declareProtected(Permissions.ManagePortal,
'manage_editProperties', # Explicitly add tabs for manage_options
'manage_changeProperties', manage_options = ({'label': 'View', 'action': 'view'},
'manage_propertiesForm', {'label': 'Contents', 'action': 'manage_main'},
) {'label': 'Security', 'action': 'manage_access'},
{'label': 'Undo', 'action': 'manage_UndoForm'},
manage_options = ( Folder.manage_options+ {'label': 'Ownership', 'action': 'manage_owner'},
OFS.History.Historical.manage_options {'label': 'Interfaces', 'action': 'manage_interfaces'},
{'label': 'Find', 'action': 'manage_findForm'},
{'label': 'History', 'action': 'manage_change_history_page'},
{'label': 'Workflows', 'action': 'manage_workflowsTab'},
) )
# Declarative properties # Declarative properties
...@@ -184,9 +168,6 @@ class ERP5Catalog(Folder, Catalog): ...@@ -184,9 +168,6 @@ class ERP5Catalog(Folder, Catalog):
, PropertySheet.Catalog , PropertySheet.Catalog
) )
# Declarative Constructors
constructors = (manage_addERP5Catalog,)
# Use functions inherited from SQLCatalog for property setters # Use functions inherited from SQLCatalog for property setters
_setPropValue = Catalog._setPropValue _setPropValue = Catalog._setPropValue
getProperty = Folder.getProperty getProperty = Folder.getProperty
......
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