Commit 310ec456 authored by Sebastien Robin's avatar Sebastien Robin

set default security setting on foo module and fix security on testTemplate

parent f81662b5
<module> <module>
<id>foo_module</id> <id>foo_module</id>
<permission_list> <permission_list>
<permission type='tuple'>
<name>Access Transient Objects</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Access contents information</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Access session data</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Add portal content</name>
<role>Assignor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Add portal folders</name>
<role>Assignor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Change local roles</name>
<role>Assignor</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Copy or Move</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Delete objects</name>
<role>Assignor</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>List folder contents</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Modify portal content</name>
<role>Assignor</role>
<role>Manager</role>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>View</name> <name>View</name>
<role>Assignee</role> <role>Assignee</role>
...@@ -9,6 +81,15 @@ ...@@ -9,6 +81,15 @@
<role>Auditor</role> <role>Auditor</role>
<role>Manager</role> <role>Manager</role>
</permission> </permission>
<permission type='tuple'>
<name>View History</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Author</role>
<role>Manager</role>
</permission>
</permission_list> </permission_list>
<portal_type>Foo Module</portal_type> <portal_type>Foo Module</portal_type>
<title>Foos</title> <title>Foos</title>
......
681 682
\ No newline at end of file \ No newline at end of file
...@@ -52,7 +52,7 @@ class TestTemplate(ERP5TypeTestCase): ...@@ -52,7 +52,7 @@ class TestTemplate(ERP5TypeTestCase):
def createUserAndLogin(self, name=None, additional_role_list=[]): def createUserAndLogin(self, name=None, additional_role_list=[]):
"""login with Member, Author and specified roles.""" """login with Member, Author and specified roles."""
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
role_list = ['Member', 'Author'] role_list = ['Member', 'Author', 'Auditor']
role_list.extend(additional_role_list) role_list.extend(additional_role_list)
uf._doAddUser(name, '', role_list, []) uf._doAddUser(name, '', role_list, [])
user = uf.getUserById(name).__of__(uf) user = uf.getUserById(name).__of__(uf)
...@@ -66,10 +66,6 @@ class TestTemplate(ERP5TypeTestCase): ...@@ -66,10 +66,6 @@ class TestTemplate(ERP5TypeTestCase):
self.tic() self.tic()
self.portal.portal_types.Preference._setTypeAllowedContentTypeList( self.portal.portal_types.Preference._setTypeAllowedContentTypeList(
('Foo', 'Knowledge Pad')) ('Foo', 'Knowledge Pad'))
self.portal.foo_module.manage_role(role_to_manage='Author',
permissions=[Permissions.AddPortalContent,
Permissions.CopyOrMove,
])
def test_Template(self): def test_Template(self):
self.createUserAndLogin(self.id()) self.createUserAndLogin(self.id())
......
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