Commit c7e7347f authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: Drop unecessary Security Roles Definitions

parent eae4ba5a
...@@ -5,11 +5,4 @@ ...@@ -5,11 +5,4 @@
<multi_property id='category'>group/company</multi_property> <multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property> <multi_property id='base_category'>group</multi_property>
</role> </role>
<role id='Author'>
<property id='title'>Security for Shacache (Author)</property>
<multi_property id='categories'>local_role_group/user</multi_property>
<multi_property id='category'>role/member</multi_property>
<multi_property id='category'>role/computer</multi_property>
<multi_property id='category'>role/instance</multi_property>
</role>
</type_roles> </type_roles>
\ No newline at end of file
...@@ -5,11 +5,4 @@ ...@@ -5,11 +5,4 @@
<multi_property id='category'>group/company</multi_property> <multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property> <multi_property id='base_category'>group</multi_property>
</role> </role>
<role id='Author'>
<property id='title'>Security for Shacache (Author)</property>
<multi_property id='categories'>local_role_group/user</multi_property>
<multi_property id='category'>role/member</multi_property>
<multi_property id='category'>role/computer</multi_property>
<multi_property id='category'>role/instance</multi_property>
</role>
</type_roles> </type_roles>
\ No newline at end of file
...@@ -5,11 +5,4 @@ ...@@ -5,11 +5,4 @@
<multi_property id='category'>group/company</multi_property> <multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property> <multi_property id='base_category'>group</multi_property>
</role> </role>
<role id='Author'>
<property id='title'>Security for Shacache (Author)</property>
<multi_property id='categories'>local_role_group/user</multi_property>
<multi_property id='category'>role/member</multi_property>
<multi_property id='category'>role/computer</multi_property>
<multi_property id='category'>role/instance</multi_property>
</role>
</type_roles> </type_roles>
\ No newline at end of file
...@@ -5,10 +5,4 @@ ...@@ -5,10 +5,4 @@
<multi_property id='category'>group/company</multi_property> <multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property> <multi_property id='base_category'>group</multi_property>
</role> </role>
<role id='Author'>
<property id='title'>Member</property>
<multi_property id='categories'>local_role_group/user</multi_property>
<multi_property id='category'>role/member</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
</type_roles> </type_roles>
\ No newline at end of file
...@@ -324,11 +324,8 @@ class TestDataSet(TestSlapOSGroupRoleSecurityMixin): ...@@ -324,11 +324,8 @@ class TestDataSet(TestSlapOSGroupRoleSecurityMixin):
data_set.updateLocalRolesOnSecurityGroups() data_set.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(data_set, self.assertSecurityGroup(data_set,
[self.user_id, 'G-COMPANY', 'R-COMPUTER', 'R-INSTANCE', 'R-MEMBER'], [self.user_id, 'G-COMPANY'],
False) False)
self.assertRoles(data_set, 'R-COMPUTER', ['Auditor'])
self.assertRoles(data_set, 'R-INSTANCE', ['Auditor'])
self.assertRoles(data_set, 'R-MEMBER', ['Auditor'])
self.assertRoles(data_set, 'G-COMPANY', ['Assignor']) self.assertRoles(data_set, 'G-COMPANY', ['Assignor'])
self.assertRoles(data_set, self.user_id, ['Owner']) self.assertRoles(data_set, self.user_id, ['Owner'])
...@@ -337,10 +334,7 @@ class TestDataSetModule(TestSlapOSGroupRoleSecurityMixin): ...@@ -337,10 +334,7 @@ class TestDataSetModule(TestSlapOSGroupRoleSecurityMixin):
module = self.portal.data_set_module module = self.portal.data_set_module
self.changeOwnership(module) self.changeOwnership(module)
self.assertSecurityGroup(module, self.assertSecurityGroup(module,
['G-COMPANY', 'R-COMPUTER', 'R-INSTANCE', 'R-MEMBER', self.user_id], False) ['G-COMPANY', self.user_id], False)
self.assertRoles(module, 'R-COMPUTER', ['Author'])
self.assertRoles(module, 'R-INSTANCE', ['Author'])
self.assertRoles(module, 'R-MEMBER', ['Author'])
self.assertRoles(module, 'G-COMPANY', ['Author', 'Auditor']) self.assertRoles(module, 'G-COMPANY', ['Author', 'Auditor'])
self.assertRoles(module, self.user_id, ['Owner']) self.assertRoles(module, self.user_id, ['Owner'])
...@@ -349,38 +343,28 @@ class TestDocumentModule(TestSlapOSGroupRoleSecurityMixin): ...@@ -349,38 +343,28 @@ class TestDocumentModule(TestSlapOSGroupRoleSecurityMixin):
module = self.portal.document_module module = self.portal.document_module
self.changeOwnership(module) self.changeOwnership(module)
self.assertSecurityGroup(module, self.assertSecurityGroup(module,
['R-COMPUTER', 'R-INSTANCE', 'R-MEMBER', self.user_id, 'G-COMPANY'], False) [self.user_id, 'G-COMPANY'], False)
self.assertRoles(module, 'R-COMPUTER', ['Author'])
self.assertRoles(module, 'R-INSTANCE', ['Author'])
self.assertRoles(module, 'R-MEMBER', ['Author'])
self.assertRoles(module, 'G-COMPANY', ['Author', 'Auditor']) self.assertRoles(module, 'G-COMPANY', ['Author', 'Auditor'])
self.assertRoles(module, self.user_id, ['Owner']) self.assertRoles(module, self.user_id, ['Owner'])
class TestDrawing(TestSlapOSGroupRoleSecurityMixin): class TestDrawing(TestSlapOSGroupRoleSecurityMixin):
def test_SecurityForShacache(self): def test(self):
drawing = self.portal.document_module.newContent(portal_type='Drawing') drawing = self.portal.document_module.newContent(portal_type='Drawing')
drawing.updateLocalRolesOnSecurityGroups() drawing.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(drawing, self.assertSecurityGroup(drawing,
['G-COMPANY', self.user_id, 'R-COMPUTER', 'R-INSTANCE', 'R-MEMBER'], ['G-COMPANY', self.user_id,], False)
False)
self.assertRoles(drawing, 'R-COMPUTER', ['Auditor'])
self.assertRoles(drawing, 'R-INSTANCE', ['Auditor'])
self.assertRoles(drawing, 'R-MEMBER', ['Auditor'])
self.assertRoles(drawing, 'G-COMPANY', ['Assignor']) self.assertRoles(drawing, 'G-COMPANY', ['Assignor'])
self.assertRoles(drawing, self.user_id, ['Owner']) self.assertRoles(drawing, self.user_id, ['Owner'])
class TestFile(TestSlapOSGroupRoleSecurityMixin): class TestFile(TestSlapOSGroupRoleSecurityMixin):
def test_SecurityForShacache(self): def test(self):
file_ = self.portal.document_module.newContent(portal_type='File') file_ = self.portal.document_module.newContent(portal_type='File')
file_.updateLocalRolesOnSecurityGroups() file_.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(file_, self.assertSecurityGroup(file_,
['G-COMPANY', self.user_id, 'R-COMPUTER', 'R-INSTANCE', 'R-MEMBER'], ['G-COMPANY', self.user_id],
False) False)
self.assertRoles(file_, 'R-COMPUTER', ['Auditor'])
self.assertRoles(file_, 'R-INSTANCE', ['Auditor'])
self.assertRoles(file_, 'R-MEMBER', ['Auditor'])
self.assertRoles(file_, 'G-COMPANY', ['Assignor']) self.assertRoles(file_, 'G-COMPANY', ['Assignor'])
self.assertRoles(file_, self.user_id, ['Owner']) self.assertRoles(file_, self.user_id, ['Owner'])
...@@ -427,16 +411,13 @@ class TestHostingSubscriptionModule(TestSlapOSGroupRoleSecurityMixin): ...@@ -427,16 +411,13 @@ class TestHostingSubscriptionModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, self.user_id, ['Owner']) self.assertRoles(module, self.user_id, ['Owner'])
class TestImage(TestSlapOSGroupRoleSecurityMixin): class TestImage(TestSlapOSGroupRoleSecurityMixin):
def test_SecurityForShacache(self): def test(self):
image = self.portal.image_module.newContent(portal_type='Image') image = self.portal.image_module.newContent(portal_type='Image')
image.updateLocalRolesOnSecurityGroups() image.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(image, self.assertSecurityGroup(image,
['G-COMPANY', self.user_id, 'R-COMPUTER', 'R-INSTANCE', 'R-MEMBER'], ['G-COMPANY', self.user_id],
False) False)
self.assertRoles(image, 'R-COMPUTER', ['Auditor'])
self.assertRoles(image, 'R-INSTANCE', ['Auditor'])
self.assertRoles(image, 'R-MEMBER', ['Auditor'])
self.assertRoles(image, 'G-COMPANY', ['Assignor']) self.assertRoles(image, 'G-COMPANY', ['Assignor'])
self.assertRoles(image, self.user_id, ['Owner']) self.assertRoles(image, self.user_id, ['Owner'])
...@@ -539,16 +520,13 @@ class TestProject(TestSlapOSGroupRoleSecurityMixin): ...@@ -539,16 +520,13 @@ class TestProject(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(project, self.user_id, ['Owner', 'Assignee']) self.assertRoles(project, self.user_id, ['Owner', 'Assignee'])
class TestPDF(TestSlapOSGroupRoleSecurityMixin): class TestPDF(TestSlapOSGroupRoleSecurityMixin):
def test_SecurityForShacache(self): def test(self):
pdf = self.portal.document_module.newContent(portal_type='PDF') pdf = self.portal.document_module.newContent(portal_type='PDF')
pdf.updateLocalRolesOnSecurityGroups() pdf.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(pdf, self.assertSecurityGroup(pdf,
['G-COMPANY', self.user_id, 'R-COMPUTER', 'R-INSTANCE', 'R-MEMBER'], ['G-COMPANY', self.user_id],
False) False)
self.assertRoles(pdf, 'R-COMPUTER', ['Auditor'])
self.assertRoles(pdf, 'R-INSTANCE', ['Auditor'])
self.assertRoles(pdf, 'R-MEMBER', ['Auditor'])
self.assertRoles(pdf, 'G-COMPANY', ['Assignor']) self.assertRoles(pdf, 'G-COMPANY', ['Assignor'])
self.assertRoles(pdf, self.user_id, ['Owner']) self.assertRoles(pdf, self.user_id, ['Owner'])
...@@ -658,17 +636,14 @@ class TestPersonModule(TestSlapOSGroupRoleSecurityMixin): ...@@ -658,17 +636,14 @@ class TestPersonModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, self.user_id, ['Owner']) self.assertRoles(module, self.user_id, ['Owner'])
class TestPresentation(TestSlapOSGroupRoleSecurityMixin): class TestPresentation(TestSlapOSGroupRoleSecurityMixin):
def test_SecurityForShacache(self): def test(self):
presentation = self.portal.document_module.newContent( presentation = self.portal.document_module.newContent(
portal_type='Presentation') portal_type='Presentation')
presentation.updateLocalRolesOnSecurityGroups() presentation.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(presentation, self.assertSecurityGroup(presentation,
['G-COMPANY', self.user_id, 'R-COMPUTER', 'R-INSTANCE', 'R-MEMBER'], ['G-COMPANY', self.user_id],
False) False)
self.assertRoles(presentation, 'R-COMPUTER', ['Auditor'])
self.assertRoles(presentation, 'R-INSTANCE', ['Auditor'])
self.assertRoles(presentation, 'R-MEMBER', ['Auditor'])
self.assertRoles(presentation, 'G-COMPANY', ['Assignor']) self.assertRoles(presentation, 'G-COMPANY', ['Assignor'])
self.assertRoles(presentation, self.user_id, ['Owner']) self.assertRoles(presentation, self.user_id, ['Owner'])
...@@ -893,32 +868,26 @@ class TestSoftwareReleaseModule(TestSlapOSGroupRoleSecurityMixin): ...@@ -893,32 +868,26 @@ class TestSoftwareReleaseModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, self.user_id, ['Owner']) self.assertRoles(module, self.user_id, ['Owner'])
class TestSpreadsheet(TestSlapOSGroupRoleSecurityMixin): class TestSpreadsheet(TestSlapOSGroupRoleSecurityMixin):
def test_SecurityForShacache(self): def test(self):
spreadsheet = self.portal.document_module.newContent( spreadsheet = self.portal.document_module.newContent(
portal_type='Spreadsheet') portal_type='Spreadsheet')
spreadsheet.updateLocalRolesOnSecurityGroups() spreadsheet.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(spreadsheet, self.assertSecurityGroup(spreadsheet,
['G-COMPANY', self.user_id, 'R-COMPUTER', 'R-INSTANCE', 'R-MEMBER'], ['G-COMPANY', self.user_id],
False) False)
self.assertRoles(spreadsheet, 'R-COMPUTER', ['Auditor'])
self.assertRoles(spreadsheet, 'R-INSTANCE', ['Auditor'])
self.assertRoles(spreadsheet, 'R-MEMBER', ['Auditor'])
self.assertRoles(spreadsheet, 'G-COMPANY', ['Assignor']) self.assertRoles(spreadsheet, 'G-COMPANY', ['Assignor'])
self.assertRoles(spreadsheet, self.user_id, ['Owner']) self.assertRoles(spreadsheet, self.user_id, ['Owner'])
class TestText(TestSlapOSGroupRoleSecurityMixin): class TestText(TestSlapOSGroupRoleSecurityMixin):
def test_SecurityForShacache(self): def test(self):
text = self.portal.document_module.newContent( text = self.portal.document_module.newContent(
portal_type='Text') portal_type='Text')
text.updateLocalRolesOnSecurityGroups() text.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(text, self.assertSecurityGroup(text,
['G-COMPANY', self.user_id, 'R-COMPUTER', 'R-INSTANCE', 'R-MEMBER'], ['G-COMPANY', self.user_id],
False) False)
self.assertRoles(text, 'R-COMPUTER', ['Auditor'])
self.assertRoles(text, 'R-INSTANCE', ['Auditor'])
self.assertRoles(text, 'R-MEMBER', ['Auditor'])
self.assertRoles(text, 'G-COMPANY', ['Assignor']) self.assertRoles(text, 'G-COMPANY', ['Assignor'])
self.assertRoles(text, self.user_id, ['Owner']) self.assertRoles(text, self.user_id, ['Owner'])
...@@ -927,10 +896,7 @@ class TestContributionTool(TestSlapOSGroupRoleSecurityMixin): ...@@ -927,10 +896,7 @@ class TestContributionTool(TestSlapOSGroupRoleSecurityMixin):
module = self.portal.portal_contributions module = self.portal.portal_contributions
self.changeOwnership(module) self.changeOwnership(module)
self.assertSecurityGroup(module, self.assertSecurityGroup(module,
['R-COMPUTER', 'R-INSTANCE', 'R-MEMBER', self.user_id, 'G-COMPANY'], True) [self.user_id, 'G-COMPANY'], True)
self.assertRoles(module, 'R-COMPUTER', ['Author'])
self.assertRoles(module, 'R-INSTANCE', ['Author'])
self.assertRoles(module, 'R-MEMBER', ['Author'])
self.assertRoles(module, 'G-COMPANY', ['Author', 'Auditor']) self.assertRoles(module, 'G-COMPANY', ['Author', 'Auditor'])
self.assertRoles(module, self.user_id, ['Owner']) self.assertRoles(module, self.user_id, ['Owner'])
......
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