Commit 29c517b8 authored by Jérome Perrin's avatar Jérome Perrin

the log added in https://svn.erp5.org/?view=rev&revision=22250 was really to

verbose. Instead verify if the permission name is valid and don't try to
install it if not valid.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22714 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 30df4cfd
......@@ -2604,6 +2604,8 @@ class ModuleTemplateItem(BaseTemplateItem):
else:
items = self._archive
valid_permissions = dict.fromkeys([x[0] for x in
context.ac_inherited_permissions(all=1)])
for id in items.keys():
if update_dict.has_key(id) or force:
if not force:
......@@ -2620,13 +2622,8 @@ class ModuleTemplateItem(BaseTemplateItem):
module.setTitle(str(mapping['title']))
for name, role_list in list(mapping['permission_list']):
acquire = (type(role_list) == type([]))
try:
if name in valid_permissions:
module.manage_permission(name, roles=role_list, acquire=acquire)
except ValueError:
# Ignore a permission not present in this system.
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