Commit 92cfd1b9 authored by Romain Courteaud's avatar Romain Courteaud

slapos_*: compatibility with slapgrid

Keep permissions on the computer module to allow computer_module/Base_getComputerToken call
parent fba76904
<local_roles_item>
<local_roles>
</local_roles>
</local_roles_item>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>Compute Node</property>
<multi_property id='categories'>local_role_group/computer</multi_property>
<multi_property id='category'>role/computer</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
<role id='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>
<role id='Auditor'>
<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>
<role id='Auditor'>
<property id='title'>Person Shadow</property>
<multi_property id='categories'>local_role_group/shadow</multi_property>
<multi_property id='category'>role/shadow/person</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
</type_roles>
\ No newline at end of file
...@@ -263,6 +263,19 @@ class TestComputerModelModule(TestSlapOSGroupRoleSecurityMixin): ...@@ -263,6 +263,19 @@ class TestComputerModelModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author']) self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner']) self.assertRoles(module, self.user_id, ['Owner'])
class TestComputerModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.computer_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', 'R-COMPUTER', 'R-MEMBER', 'R-SHADOW-PERSON', self.user_id],
False)
self.assertRoles(module, 'R-MEMBER', ['Auditor'])
self.assertRoles(module, 'G-COMPANY', ['Auditor'])
self.assertRoles(module, 'R-COMPUTER', ['Auditor'])
self.assertRoles(module, 'R-SHADOW-PERSON', ['Auditor'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestComputeNodeModule(TestSlapOSGroupRoleSecurityMixin): class TestComputeNodeModule(TestSlapOSGroupRoleSecurityMixin):
def test(self): def test(self):
module = self.portal.compute_node_module module = self.portal.compute_node_module
......
...@@ -26,8 +26,9 @@ business_process_module/slapos_subscription_business_process ...@@ -26,8 +26,9 @@ business_process_module/slapos_subscription_business_process
campaign_module campaign_module
cloud_contract_module cloud_contract_module
component_module component_module
computer_model_module
compute_node_module compute_node_module
computer_model_module
computer_module
computer_network_module computer_network_module
consumption_document_module consumption_document_module
credential_update_module credential_update_module
...@@ -39,9 +40,9 @@ document_ingestion_module ...@@ -39,9 +40,9 @@ document_ingestion_module
document_module document_module
event_module event_module
event_module/slapos_crm_web_message_template event_module/slapos_crm_web_message_template
instance_tree_module
image_module image_module
incident_response_module incident_response_module
instance_tree_module
inventory_module inventory_module
invitation_token_module invitation_token_module
knowledge_pad_module knowledge_pad_module
......
...@@ -19,13 +19,14 @@ Cloud Contract Module ...@@ -19,13 +19,14 @@ Cloud Contract Module
Component Component
Component Module Component Module
Compute Node Compute Node
Compute Node Module
Compute Partition
Computer Consumption TioXML File Computer Consumption TioXML File
Computer Model Computer Model
Computer Model Module Computer Model Module
Compute Node Module Computer Module
Computer Network Computer Network
Computer Network Module Computer Network Module
Compute Partition
Consumption Document Module Consumption Document Module
Contract Invitation Token Contract Invitation Token
Contribution Tool Contribution Tool
...@@ -46,12 +47,12 @@ File ...@@ -46,12 +47,12 @@ File
Gadget Gadget
Gadget Tool Gadget Tool
Google Login Google Login
Instance Tree
Instance Tree Module
Image Image
Image Module Image Module
Incident Response Incident Response
Incident Response Module Incident Response Module
Instance Tree
Instance Tree Module
Integration Site Integration Site
Integration Tool Integration Tool
Inventory Inventory
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getComputerToken</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>title</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Person_requestComputer</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -3,6 +3,7 @@ portal = context.getPortalObject() ...@@ -3,6 +3,7 @@ portal = context.getPortalObject()
if (mode == 'search') and (query is not None): if (mode == 'search') and (query is not None):
# Rewrite the queries containing the Hosting Subscription string # Rewrite the queries containing the Hosting Subscription string
query = query.replace('"Hosting Subscription"', '"Instance Tree"') query = query.replace('"Hosting Subscription"', '"Instance Tree"')
query = query.replace('"Computer"', '"Compute Node"')
new_skin_name = "HalRestricted" new_skin_name = "HalRestricted"
portal.portal_skins.changeSkin(new_skin_name) portal.portal_skins.changeSkin(new_skin_name)
......
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