Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ekaterina
erp5
Commits
24ce164d
Commit
24ce164d
authored
Jan 13, 2016
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: cleanup Base_setDefaultSecurity.
parent
5a94f5fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_setDefaultSecurity.xml
...teItem/portal_skins/erp5_core/Base_setDefaultSecurity.xml
+9
-8
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_setDefaultSecurity.xml
View file @
24ce164d
...
...
@@ -52,11 +52,8 @@
<key>
<string>
_body
</string>
</key>
<value>
<string>
permission_list = context.possible_permissions()\n
\n
# First, remove all permissions (very secure by default)\n
# We should keep only Manager, or we will not be able to\n
# do the end of the script\n
for permission in permission_list:\n
context.manage_permission(permission, [\'Manager\'], 0)\n
# First, only Manager has the permission by default\n
manager_permission_list = permission_list\n
\n
# Then, define default ERP5 permissions\n
common_permission_list = [p for p in [\n
...
...
@@ -91,7 +88,7 @@ erp5_role_dict = {\n
\'Associate\': common_permission_list + auditor_permission_list,\n
\'Auditor\' : common_permission_list + auditor_permission_list,\n
\'Author\': common_permission_list + author_permission_list,\n
\'Manager\': permission_list\n
\'Manager\':
manager_
permission_list\n
}\n
\n
# Add ERP5 permissions\n
...
...
@@ -102,8 +99,12 @@ for role,permission_list in erp5_role_dict.items():\n
erp5_permission_dict[permission] = []\n
erp5_permission_dict[permission].append(role)\n
\n
for permission,role_list in erp5_permission_dict.items():\n
context.manage_permission(permission,role_list, 0)\n
for permission,role_list in sorted(erp5_permission_dict.items()):\n
# Acquire permission if the role list is same as parent\n
if sorted([x[\'name\'] for x in context.aq_parent.rolesOfPermission(permission) if x[\'selected\']]) == sorted(role_list):\n
context.manage_permission(permission, [], 1)\n
else:\n
context.manage_permission(permission,role_list, 0)\n
\n
return "finished"\n
</string>
</value>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment