Commit 51f044be authored by Jérome Perrin's avatar Jérome Perrin

log error message when module.manage_permission fails


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22250 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ce647987
......@@ -26,6 +26,7 @@
#
##############################################################################
import sys
from Shared.DC.ZRDB.Connection import Connection as RDBConnection
from Globals import Persistent, PersistentMapping
from Acquisition import Implicit, aq_base
......@@ -2662,13 +2663,15 @@ class ModuleTemplateItem(BaseTemplateItem):
else:
module = portal.newContent(id=id, portal_type=str(mapping['portal_type']))
module.setTitle(str(mapping['title']))
for name,role_list in list(mapping['permission_list']):
for name, role_list in list(mapping['permission_list']):
acquire = (type(role_list) == type([]))
try:
module.manage_permission(name, roles=role_list, acquire=acquire)
except ValueError:
# Ignore a permission not present in this system.
pass
LOG('ERP5', PROBLEM,
'Unable to update module permission "%s" with roles %s' % (
name, role_list), error=sys.exc_info())
def _importFile(self, file_name, file):
dict = {}
......
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