Commit e02177b8 authored by Jérome Perrin's avatar Jérome Perrin

make sure role exist before using it (in unit test, some products are not installed)



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9028 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 764ffcde
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
<value> <string>valid_role_list = context.valid_roles()\n <value> <string>valid_role_list = context.valid_roles()\n
role_index_list = range(len(valid_role_list))\n role_index_list = range(len(valid_role_list))\n
permission_list = context.possible_permissions()\n permission_list = context.possible_permissions()\n
#return context.possible_permissions()\n
\n \n
\n \n
# First, remove all permissions (very secure by default)\n # First, remove all permissions (very secure by default)\n
...@@ -82,24 +81,24 @@ for permission in permission_list:\n ...@@ -82,24 +81,24 @@ for permission in permission_list:\n
\n \n
# Then, define default ERP5 permissions\n # Then, define default ERP5 permissions\n
\n \n
common_permission_list = [\n common_permission_list = [p for p in [\n
\'Access Transient Objects\',\n \'Access Transient Objects\',\n
\'Access contents information\',\n \'Access contents information\',\n
\'Access session data\',\n \'Access session data\',\n
\'List folder contents\',\n \'List folder contents\',\n
\'View\',\n \'View\',\n
\'View History\',\n \'View History\',\n
]\n ] if p in permission_list]\n
\n \n
author_permission_list = [\n author_permission_list = [p for p in [\n
\'Add portal content\',\n \'Add portal content\',\n
\'Add portal folders\',\n \'Add portal folders\',\n
]\n ] if p in permission_list]\n
\n \n
assignor_permission_list = [\n assignor_permission_list = [p for p in [\n
\'Modify portal content\',\n \'Modify portal content\',\n
\'Delete objects\',\n \'Delete objects\',\n
]\n ] if p in permission_list]\n
\n \n
# Define ERP5 permissions for each role\n # Define ERP5 permissions for each role\n
erp5_role_dict = {\n erp5_role_dict = {\n
......
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