Commit aed4f303 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: Fix bootstrap of migrated bt5s.

* Upon bt5 installation, install portal_type* items before bt5 {Document,
  Extensions...} as corresponding Portal Type are required once they have been
  migrated to ZODB Components.

* Likewise portal_{property_sheets, types}, portal_components must be created
  automatically *before* installing any bt5. This is required when Products
  will be migrated but also for bt5 items before bootstrapping erp5_core bt5.

* Set Permissions in ComponentTool instanciation and revoke all permissions,
  then allow only some of them for security sake.

* When creating ERP5 site with unit tests, add ERP5TypeTestCase to Developer
  Role ASAP so that there is no Permission issue when installing bootstrap bt5
  and test bt5s containing ZODB Components.
parent 00cfb2f9
...@@ -4798,6 +4798,7 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -4798,6 +4798,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
# This is a global variable # This is a global variable
# Order is important for installation # Order is important for installation
# We want to have: # We want to have:
# * workflow and portal_type* before ZODB Component {Document,Extension...}
# * path after module, because path can be module content # * path after module, because path can be module content
# * path after categories, because path can be categories content # * path after categories, because path can be categories content
# * path after portal types roles so that roles in the current bt can be used # * path after portal types roles so that roles in the current bt can be used
...@@ -4809,6 +4810,12 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -4809,6 +4810,12 @@ Business Template is a set of definitions, such as skins, portal types and categ
_item_name_list = [ _item_name_list = [
'_registered_version_priority_selection_item', '_registered_version_priority_selection_item',
'_workflow_item', '_workflow_item',
'_portal_type_item',
#'_portal_type_workflow_chain_item',
'_portal_type_allowed_content_type_item',
'_portal_type_hidden_content_type_item',
'_portal_type_property_sheet_item',
'_portal_type_base_category_item',
'_product_item', '_product_item',
'_document_item', '_document_item',
'_property_sheet_item', '_property_sheet_item',
...@@ -4819,12 +4826,6 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -4819,12 +4826,6 @@ Business Template is a set of definitions, such as skins, portal types and categ
'_tool_item', '_tool_item',
'_message_translation_item', '_message_translation_item',
'_site_property_item', '_site_property_item',
'_portal_type_item',
#'_portal_type_workflow_chain_item',
'_portal_type_allowed_content_type_item',
'_portal_type_hidden_content_type_item',
'_portal_type_property_sheet_item',
'_portal_type_base_category_item',
'_category_item', '_category_item',
'_module_item', '_module_item',
'_portal_type_roles_item', '_portal_type_roles_item',
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Component Tool" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_Accelerated_HTTP_Cache_Managers_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_BTreeFolder2s_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Browser_Id_Manager_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_CMFActivity_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_CMFCategory_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_CMF_Action_Icons_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_CMF_Active_Processs_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_CMF_Caching_Policy_Managers_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_CMF_Calendar_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_CMF_Core_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_CMF_Default_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_CMF_Sites_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_CMF_Unique_Id_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Content_Type_Registrys_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Cookie_Crumblers_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Database_Methods_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Documents__Images__and_Files_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5Catalog_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5Configurator_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5Form_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5SecurePayment_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5ShortMessage_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5SyncML_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5TioSafe_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5Type_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5Wizard_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5_Filesystem_Formulator_Forms_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5_Form_Printouts_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5_Forms_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5_OOo_Templates_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5_PDF_Forms_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5_PDF_Templates_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5_Python_Scripts_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5_Reports_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5_Sites_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ERP5_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ExtFiles_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ExtImages_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_External_Methods_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Filesystem_Directory_Views_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Folders_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Formulator_Forms_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Generic_Setup_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_HBTreeFolder2s_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_LDAP_Connections_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_LDAP_Methods_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_LDIF_Methods_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_LocalContents_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_LocalFolders_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Localizers_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_MailHost_objects_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_MessageCatalogs_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_MimetypesRegistry_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Page_Templates_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Pluggable_Index_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Plugin_Registrys_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_PortalTransforms_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Python_Scripts_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_RAM_Cache_Managers_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ReStructuredText_Documents_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_SCHEM_Tools_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Session_Data_Manager_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Site_Roots_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Temporary_Folder_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Transient_Object_Container_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_User_Folders_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Virtual_Host_Monsters_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Vocabularies_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ZCatalogs_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_ZODB_Mount_Points_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Z_MySQL_Database_Connections_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_Z_MySQL_Deferred_Database_Connections_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_events_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_member_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_topics_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Browse_Connection_Entries_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_Browser_Id_Manager_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_DTML_Documents_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_DTML_Methods_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_Database_Connections_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_Database_Methods_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_ExtFile_ExtImage_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_External_Methods_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_Formulator_Fields_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_Formulator_Forms_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_LDAP_Methods_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_Page_Templates_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_Python_Scripts_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_Session_Data_Manager_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_bindings_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_cache_managers_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_cache_settings_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_configuration_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_permissions_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_portal_events_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_portal_topics_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_proxy_roles_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Create_New_Entry_Objects_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Create_Transient_Objects_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Define_permissions_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_Entry_Objects_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Download_ExtFile_ExtImage_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Edit_ReStructuredText_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Edit_connection_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Edit_target_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_FTP_access_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Import_Export_objects_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_List_folder_contents_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_List_portal_members_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_List_undoable_changes_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Log_Site_Errors_Permission</string> </key>
<value>
<list>
<string>Developer</string>
</list>
</value>
</item>
<item>
<key> <string>_Log_to_the_Event_Log_Permission</string> </key>
<value>
<list>
<string>Developer</string>
</list>
</value>
</item>
<item>
<key> <string>_Mail_forgotten_password_Permission</string> </key>
<value>
<list>
<string>Developer</string>
</list>
</value>
</item>
<item>
<key> <string>_Manage_Access_Rules_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_Entry_information_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_Five_local_sites_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_Groups_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_Selenium_test_cases_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_Site_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_Transient_Object_Container_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_Vocabulary_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_WebDAV_Locks_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_ZCatalogIndex_Entries_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_ZCatalog_Entries_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_languages_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_messages_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_portal_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_properties_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Manage_users_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_Cookie_Crumblers_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Open_Close_Connection_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Open_Close_Database_Connection_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Open_Close_Database_Connections_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Query_Vocabulary_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Reply_to_item_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Request_review_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Reset_dynamic_classes_Permission</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Review_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Search_ZCatalog_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Search_for_principals_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Set_own_password_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Set_own_properties_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Take_ownership_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Test_Database_Connections_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Translate_Content_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Undo_changes_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Use_Database_Methods_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Use_LDAP_Methods_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Use_external_editor_Permission</string> </key>
<value>
<tuple>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>__ac_roles__</string> </key>
<value>
<tuple>
<string>Manager</string>
<string>Owner</string>
<string>Anonymous</string>
<string>Authenticated</string>
<string>Developer</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>portal_components</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Components</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
2013-06-25 arnaud.fontaine
* ZODB Components: Fix bootstrap of migrated bt5s.
2013-06-24 arnaud.fontaine 2013-06-24 arnaud.fontaine
* Meaningless to remove ZODB Components migrated from FS. This will not work when there are several nodes anyway, so just display a message to the user. * Meaningless to remove ZODB Components migrated from FS. This will not work when there are several nodes anyway, so just display a message to the user.
......
41110 41111
\ No newline at end of file \ No newline at end of file
mimetypes_registry mimetypes_registry
portal_components
portal_contribution_registry portal_contribution_registry
portal_notifications portal_notifications
portal_sessions portal_sessions
......
...@@ -41,7 +41,6 @@ from Products.CMFCore.Expression import Expression ...@@ -41,7 +41,6 @@ from Products.CMFCore.Expression import Expression
from Products.ERP5Type.tests.utils import LogInterceptor from Products.ERP5Type.tests.utils import LogInterceptor
from Products.ERP5Type.Workflow import addWorkflowByType from Products.ERP5Type.Workflow import addWorkflowByType
from Products.ERP5Type.tests.backportUnittest import expectedFailure, skip from Products.ERP5Type.tests.backportUnittest import expectedFailure, skip
from Products.ERP5Type.tests.testDynamicClassGeneration import TestDeveloperMixin
from Products.ERP5VCS.WorkingCopy import getVcsTool from Products.ERP5VCS.WorkingCopy import getVcsTool
import shutil import shutil
import os import os
...@@ -58,7 +57,7 @@ from Products.PortalTransforms.Transform import Transform ...@@ -58,7 +57,7 @@ from Products.PortalTransforms.Transform import Transform
Transform_tr_init = Transform._tr_init Transform_tr_init = Transform._tr_init
Transform_manage_beforeDelete = Transform.manage_beforeDelete Transform_manage_beforeDelete = Transform.manage_beforeDelete
class BusinessTemplateMixin(TestDeveloperMixin, ERP5TypeTestCase, LogInterceptor): class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
def getBusinessTemplateList(self): def getBusinessTemplateList(self):
return ('erp5_base', return ('erp5_base',
'erp5_csv_style', 'erp5_csv_style',
......
...@@ -35,6 +35,7 @@ import sys ...@@ -35,6 +35,7 @@ import sys
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
from AccessControl.Permission import Permission
from Products.ERP5Type.Tool.BaseTool import BaseTool from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type.Base import Base from Products.ERP5Type.Base import Base
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
...@@ -61,6 +62,51 @@ class ComponentTool(BaseTool): ...@@ -61,6 +62,51 @@ class ComponentTool(BaseTool):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
def __init__(self, *args, **kwargs):
"""
Except 'Access *', 'View*' and 'WebDAV' permissions (Acquired) and 'Reset
dynamic classes' (Manager, required to reset Components), everything
requires Developer Role.
Another solution would be to load it from XML as it was previously done,
but from a security point of view, it's better to forbid everything and
allows only some.
XXX-arnau: Really all 'Access *' and 'View*'? nothing else?
"""
obj = BaseTool.__init__(self, *args, **kwargs)
for permission_tuple in self.ac_inherited_permissions(1):
name = permission_tuple[0]
value = permission_tuple[1]
if name == 'Reset dynamic classes':
p = Permission(name, value, self)
p.setRoles(('Manager',))
elif not (name.startswith('Access ') or
name.startswith('View') or
name.startswith('WebDAV')):
p = Permission(name, value, self)
p.setRoles(('Developer',))
return obj
def _isBootstrapRequired(self):
"""
Required by synchronizeDynamicModules() to bootstrap an empty site and
thus create portal_components
XXX-arnau: Only bt5 items for now
"""
return False
def _bootstrap(self):
"""
Required by synchronizeDynamicModules() to bootstrap an empty site and
thus create portal_components
XXX-arnau: Only bt5 items for now
"""
pass
security.declareProtected(Permissions.ResetDynamicClasses, 'reset') security.declareProtected(Permissions.ResetDynamicClasses, 'reset')
def reset(self, def reset(self,
force=False, force=False,
......
...@@ -332,8 +332,9 @@ def synchronizeDynamicModules(context, force=False): ...@@ -332,8 +332,9 @@ def synchronizeDynamicModules(context, force=False):
migrate = False migrate = False
from Products.ERP5Type.Tool.PropertySheetTool import PropertySheetTool from Products.ERP5Type.Tool.PropertySheetTool import PropertySheetTool
from Products.ERP5Type.Tool.TypesTool import TypesTool from Products.ERP5Type.Tool.TypesTool import TypesTool
from Products.ERP5Type.Tool.ComponentTool import ComponentTool
try: try:
for tool_class in TypesTool, PropertySheetTool: for tool_class in TypesTool, PropertySheetTool, ComponentTool:
# if the instance has no property sheet tool, or incomplete # if the instance has no property sheet tool, or incomplete
# property sheets, we need to import some data to bootstrap # property sheets, we need to import some data to bootstrap
# (only likely to happen on the first run ever) # (only likely to happen on the first run ever)
......
...@@ -218,6 +218,21 @@ def _parse_args(self, *args, **kw): ...@@ -218,6 +218,21 @@ def _parse_args(self, *args, **kw):
_parse_args._original = DateTime._original_parse_args _parse_args._original = DateTime._original_parse_args
DateTime._parse_args = _parse_args DateTime._parse_args = _parse_args
def addUserToDeveloperRole(user_name):
config = getConfiguration()
product_config = getattr(config, 'product_config', None)
if product_config is None:
product_config = config.product_config = {}
if product_config.get('erp5') is None:
class DummyDeveloperConfig(object):
pass
dummy_developer_config = DummyDeveloperConfig()
dummy_developer_config.developer_list = [user_name]
product_config['erp5'] = dummy_developer_config
elif user_name not in product_config['erp5'].developer_list:
product_config['erp5'].developer_list.append(user_name)
class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase): class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
"""Mixin class for ERP5 based tests. """Mixin class for ERP5 based tests.
""" """
...@@ -998,6 +1013,11 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin): ...@@ -998,6 +1013,11 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
'Assignor', 'Author', 'Auditor', 'Associate'], []) 'Assignor', 'Author', 'Auditor', 'Associate'], [])
user = uf.getUserById('ERP5TypeTestCase').__of__(uf) user = uf.getUserById('ERP5TypeTestCase').__of__(uf)
newSecurityManager(None, user) newSecurityManager(None, user)
# bt5s contain ZODB Components which can be only installed if the
# user has Developer Role
addUserToDeveloperRole('ERP5TypeTestCase')
# Add ERP5 Site # Add ERP5 Site
reindex = 1 reindex = 1
if hot_reindexing: if hot_reindexing:
......
...@@ -1244,31 +1244,7 @@ from Products.ERP5Type.mixin.component import ComponentMixin ...@@ -1244,31 +1244,7 @@ from Products.ERP5Type.mixin.component import ComponentMixin
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
from App.config import getConfiguration from App.config import getConfiguration
class TestDeveloperMixin: class _TestZodbComponent(SecurityTestCase):
def login(self, user_name='ERP5TypeTestCase', quiet=0):
"""
Make sure that the test user has Developer Role, otherwise the user cannot
do anything on Components...
"""
config = getConfiguration()
product_config = getattr(config, 'product_config', None)
if product_config is None:
product_config = config.product_config = {}
if product_config.get('erp5') is None:
class DummyDeveloperConfig(object):
pass
dummy_developer_config = DummyDeveloperConfig()
dummy_developer_config.developer_list = [user_name]
product_config['erp5'] = dummy_developer_config
elif user_name not in product_config['erp5'].developer_list:
product_config['erp5'].developer_list.append(user_name)
return ERP5TypeTestCase.login(self, user_name, quiet)
class _TestZodbComponent(TestDeveloperMixin, SecurityTestCase):
""" """
Abstract class which defined convenient methods used by any Component Test Abstract class which defined convenient methods used by any Component Test
and tests ran for all Component Test classes and tests ran for all Component Test classes
......
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