Commit 49df4003 authored by Romain Courteaud's avatar Romain Courteaud

Add sql_catalog_role_keys and sql_catalog_local_role_keys to catalog, in order

to configure explicitely which column should be mapped when generation security
query.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19406 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bbde4298
...@@ -449,6 +449,17 @@ class Catalog(Folder, ...@@ -449,6 +449,17 @@ class Catalog(Folder,
'description' : 'Virtual columns to generate scriptable scriptable queries', 'description' : 'Virtual columns to generate scriptable scriptable queries',
'type' : 'lines', 'type' : 'lines',
'mode' : 'w' }, 'mode' : 'w' },
{ 'id': 'sql_catalog_role_keys',
'title': 'Role keys',
'description': 'Columns which should be used to map a monovalued role',
'type': 'lines',
'mode': 'w' },
{ 'id': 'sql_catalog_local_role_keys',
'title': 'Local Role keys',
'description': 'Columns which should be used to map' \
'a monovalued local role',
'type': 'lines',
'mode': 'w' },
) )
sql_catalog_produce_reserved = '' sql_catalog_produce_reserved = ''
...@@ -484,6 +495,8 @@ class Catalog(Folder, ...@@ -484,6 +495,8 @@ class Catalog(Folder,
sql_catalog_index_on_order_keys = () sql_catalog_index_on_order_keys = ()
sql_catalog_related_keys = () sql_catalog_related_keys = ()
sql_catalog_scriptable_keys = () sql_catalog_scriptable_keys = ()
sql_catalog_role_keys = ()
sql_catalog_local_role_keys = ()
# These are ZODB variables, so shared by multiple Zope instances. # These are ZODB variables, so shared by multiple Zope instances.
# This is set to the last logical time when clearReserved is called. # This is set to the last logical time when clearReserved is called.
...@@ -515,6 +528,20 @@ class Catalog(Folder, ...@@ -515,6 +528,20 @@ class Catalog(Folder,
self.indexes = {} # empty mapping self.indexes = {} # empty mapping
self.filter_dict = PersistentMapping() self.filter_dict = PersistentMapping()
def getSQLCatalogRoleKeysList(self):
"""
Return the list of role keys.
"""
return [tuple([y.strip() for y in x.split('|')]) \
for x in self.sql_catalog_role_keys]
def getSQLCatalogLocalRoleKeysList(self):
"""
Return the list of local role keys.
"""
return [tuple([y.strip() for y in x.split('|')]) \
for x in self.sql_catalog_local_role_keys]
def manage_exportProperties(self, REQUEST=None, RESPONSE=None): def manage_exportProperties(self, REQUEST=None, RESPONSE=None):
""" """
Export properties to an XML file. Export properties to an XML file.
......
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