Commit b0100fa6 authored by Rafael Monnerat's avatar Rafael Monnerat

Security cleanup

See merge request !456
parents 9247d1ac 19b448c4
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
......@@ -447,36 +447,6 @@ class TestDataSetModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, 'G-COMPANY', ['Author', 'Auditor'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestDocumentModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.document_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
[self.user_id, 'G-COMPANY'], False)
self.assertRoles(module, 'G-COMPANY', ['Author', 'Auditor'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestDrawing(TestSlapOSGroupRoleSecurityMixin):
def test(self):
drawing = self.portal.document_module.newContent(portal_type='Drawing')
drawing.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(drawing,
['G-COMPANY', self.user_id,], False)
self.assertRoles(drawing, 'G-COMPANY', ['Assignor'])
self.assertRoles(drawing, self.user_id, ['Owner'])
class TestFile(TestSlapOSGroupRoleSecurityMixin):
def test(self):
file_ = self.portal.document_module.newContent(portal_type='File')
file_.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(file_,
['G-COMPANY', self.user_id],
False)
self.assertRoles(file_, 'G-COMPANY', ['Assignor'])
self.assertRoles(file_, self.user_id, ['Owner'])
class TestInstanceTree(TestSlapOSGroupRoleSecurityMixin):
def test_RelatedSoftwareInstanceGroup(self):
reference = 'TESTHS-%s' % self.generateNewId()
......@@ -574,26 +544,6 @@ class TestInstanceTreeModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestImage(TestSlapOSGroupRoleSecurityMixin):
def test(self):
image = self.portal.image_module.newContent(portal_type='Image')
image.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(image,
['G-COMPANY', self.user_id],
False)
self.assertRoles(image, 'G-COMPANY', ['Assignor'])
self.assertRoles(image, self.user_id, ['Owner'])
class TestImageModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.image_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
[self.user_id, 'G-COMPANY'], False)
self.assertRoles(module, 'G-COMPANY', ['Author', 'Auditor'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestOrganisation(TestSlapOSGroupRoleSecurityMixin):
def test(self):
organisation = self.portal.organisation_module.newContent(
......@@ -694,18 +644,6 @@ class TestProject(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(project, project.getReference(), ['Assignee'])
self.assertRoles(project, 'R-SHADOW-PERSON', ['Auditor'])
self.assertRoles(project, self.user_id, ['Owner'])
class TestPDF(TestSlapOSGroupRoleSecurityMixin):
def test(self):
pdf = self.portal.document_module.newContent(portal_type='PDF')
pdf.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(pdf,
['G-COMPANY', self.user_id],
False)
self.assertRoles(pdf, 'G-COMPANY', ['Assignor'])
self.assertRoles(pdf, self.user_id, ['Owner'])
class TestPerson(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
......@@ -835,18 +773,6 @@ class TestPersonModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, 'R-SHADOW-PERSON', ['Auditor'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestPresentation(TestSlapOSGroupRoleSecurityMixin):
def test(self):
presentation = self.portal.document_module.newContent(
portal_type='Presentation')
presentation.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(presentation,
['G-COMPANY', self.user_id],
False)
self.assertRoles(presentation, 'G-COMPANY', ['Assignor'])
self.assertRoles(presentation, self.user_id, ['Owner'])
class TestSlaveInstance(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
instance = self.portal.software_instance_module.newContent(
......@@ -1249,39 +1175,6 @@ class TestSoftwareReleaseModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestSpreadsheet(TestSlapOSGroupRoleSecurityMixin):
def test(self):
spreadsheet = self.portal.document_module.newContent(
portal_type='Spreadsheet')
spreadsheet.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(spreadsheet,
['G-COMPANY', self.user_id],
False)
self.assertRoles(spreadsheet, 'G-COMPANY', ['Assignor'])
self.assertRoles(spreadsheet, self.user_id, ['Owner'])
class TestText(TestSlapOSGroupRoleSecurityMixin):
def test(self):
text = self.portal.document_module.newContent(
portal_type='Text')
text.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(text,
['G-COMPANY', self.user_id],
False)
self.assertRoles(text, 'G-COMPANY', ['Assignor'])
self.assertRoles(text, self.user_id, ['Owner'])
class TestContributionTool(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.portal_contributions
self.changeOwnership(module)
self.assertSecurityGroup(module,
[self.user_id, 'G-COMPANY'], True)
self.assertRoles(module, 'G-COMPANY', ['Author', 'Auditor'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestOpenSaleOrderModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.open_sale_order_module
......@@ -1301,25 +1194,6 @@ class TestOpenSaleOrder(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestSaleOrderModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.sale_order_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', self.user_id], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestSaleOrder(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.sale_order_module.newContent(
portal_type='Sale Order')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestSalePackingListModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.sale_packing_list_module
......@@ -1750,25 +1624,6 @@ class TestCashRegister(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestComponentModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.component_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', self.user_id], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestComponent(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.component_module.newContent(
portal_type='Component')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestCreditCard(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.organisation_module.newContent(
......@@ -1799,74 +1654,6 @@ class TestEventModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, 'R-MEMBER', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestGadget(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.portal_gadgets.newContent(
portal_type='Gadget')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestGadgetTool(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.portal_gadgets
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', self.user_id], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestInventory(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.inventory_module.newContent(
portal_type='Inventory')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestInventoryModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.inventory_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', self.user_id], False)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestKnowledgeBox(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.knowledge_pad_module.newContent(
portal_type='Knowledge Pad').newContent(
portal_type='Knowledge Box')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], True)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestKnowledgePad(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.knowledge_pad_module.newContent(
portal_type='Knowledge Pad')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestKnowledgePadModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.knowledge_pad_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', self.user_id], False)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestMailMessage(TestSlapOSGroupRoleSecurityMixin):
event_portal_type = 'Mail Message'
def test_GroupCompany(self):
......@@ -2087,25 +1874,6 @@ class TestFaxMessage(TestMailMessage):
class TestLetter(TestMailMessage):
event_portal_type = 'Letter'
class TestMeeting(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.meeting_module.newContent(
portal_type='Meeting')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestMeetingModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.meeting_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', self.user_id], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestNotificationMessageModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.notification_message_module
......@@ -2144,82 +1912,6 @@ class TestProduct(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestPurchaseOrderModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.purchase_order_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', self.user_id], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestPurchaseOrder(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.purchase_order_module.newContent(
portal_type='Purchase Order')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestPurchaseTradeConditionModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.purchase_trade_condition_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', self.user_id], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestPurchaseTradeCondition(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.purchase_trade_condition_module.newContent(
portal_type='Purchase Trade Condition')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestQueryModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.query_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', self.user_id], False)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestQuery(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.query_module.newContent(
portal_type='Query')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestSaleOpportunityModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.sale_opportunity_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', self.user_id], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestSaleOpportunity(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.sale_opportunity_module.newContent(
portal_type='Sale Opportunity')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestSupportRequestModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.support_request_module
......@@ -2391,25 +2083,6 @@ class TestSupportRequest(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(support_request, organisation.getReference(), ['Auditor'])
class TestTransformationModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.transformation_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', self.user_id], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestTransformation(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.transformation_module.newContent(
portal_type='Transformation')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestWebPageModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.web_page_module
......
......@@ -25,7 +25,6 @@ business_process_module/slapos_consumption_business_process
business_process_module/slapos_subscription_business_process
campaign_module
cloud_contract_module
component_module
compute_node_module
computer_model_module
computer_module
......@@ -37,36 +36,24 @@ currency_module/CNY
currency_module/EUR
data_set_module
document_ingestion_module
document_module
event_module
event_module/slapos_crm_web_message_template
image_module
incident_response_module
instance_tree_module
inventory_module
invitation_token_module
knowledge_pad_module
meeting_module
notification_message_module
open_sale_order_module
organisation_module
organisation_module/slapos
organisation_module/slapos/bank_account
person_module
portal_contributions
portal_gadgets
portal_integrations
portal_integrations/slapos_payzen_test_integration
portal_integrations/slapos_wechat_test_integration
product_module
project_module
purchase_order_module
purchase_trade_condition_module
query_module
regularisation_request_module
regularisation_request_module/slapos_crm_regularisation_request_template
sale_opportunity_module
sale_order_module
sale_packing_list_module
sale_trade_condition_module
sale_trade_condition_module/payzen_sale_trade_condition
......@@ -115,6 +102,4 @@ subscription_request_module
support_request_module
support_request_module/slapos_crm_support_request_template
system_event_module
transformation_module
upgrade_decision_module
web_page_module
\ No newline at end of file
upgrade_decision_module
\ No newline at end of file
......@@ -16,8 +16,6 @@ Cash Register
Certificate Login
Cloud Contract
Cloud Contract Module
Component
Component Module
Compute Node
Compute Node Module
Compute Partition
......@@ -29,7 +27,6 @@ Computer Network
Computer Network Module
Consumption Document Module
Contract Invitation Token
Contribution Tool
Credential Update Module
Credit Card
Currency
......@@ -37,34 +34,20 @@ Currency Module
Data Set
Data Set Module
Document Ingestion Module
Document Module
Drawing
ERP5 Login
Event Module
Facebook Login
Fax Message
File
Gadget
Gadget Tool
Google Login
Image
Image Module
Incident Response
Incident Response Module
Instance Tree
Instance Tree Module
Integration Site
Integration Tool
Inventory
Inventory Module
Invitation Token Module
Knowledge Box
Knowledge Pad
Knowledge Pad Module
Letter
Mail Message
Meeting
Meeting Module
Note
Notification Message
Notification Message Module
......@@ -73,32 +56,21 @@ Open Sale Order
Open Sale Order Module
Organisation
Organisation Module
PDF
Payment Transaction
Payzen Event
Person
Person Module
Phone Call
Presentation
Product
Product Module
Project
Project Module
Purchase Invoice Transaction
Purchase Order
Purchase Order Module
Purchase Trade Condition
Purchase Trade Condition Module
Query
Query Module
Regularisation Request
Regularisation Request Module
Restricted Access Token
Sale Invoice Transaction
Sale Opportunity
Sale Opportunity Module
Sale Order
Sale Order Module
Sale Packing List
Sale Packing List Module
Sale Trade Condition
......@@ -116,7 +88,6 @@ Software Product
Software Product Module
Software Release
Software Release Module
Spreadsheet
Subscription Condition
Subscription Condition Module
Subscription Request
......@@ -124,9 +95,6 @@ Subscription Request Module
Support Request
Support Request Module
System Event Module
Text
Transformation
Transformation Module
Upgrade Decision
Upgrade Decision Module
User Consumption HTML File
......
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