From 716d70baee5fb8164a05abfbf2350f534aa43e79 Mon Sep 17 00:00:00 2001 From: Carlos Roca Date: Mon, 2 Oct 2023 15:18:17 +0200 Subject: [PATCH] [IMP] vault: Add new groups to allow importing/exporting secrets --- vault/__manifest__.py | 1 + vault/models/res_config_settings.py | 6 ++++++ vault/security/vault_security.xml | 13 +++++++++++++ vault/views/res_config_settings_views.xml | 22 ++++++++++++++++++++++ vault/views/vault_entry_views.xml | 2 ++ vault/views/vault_views.xml | 7 ++----- 6 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 vault/security/vault_security.xml diff --git a/vault/__manifest__.py b/vault/__manifest__.py index 79d7c576ab..dcd66a5753 100644 --- a/vault/__manifest__.py +++ b/vault/__manifest__.py @@ -14,6 +14,7 @@ "data": [ "security/ir.model.access.csv", "security/ir_rule.xml", + "security/vault_security.xml", "views/res_config_settings_views.xml", "views/res_users_views.xml", "views/vault_entry_views.xml", diff --git a/vault/models/res_config_settings.py b/vault/models/res_config_settings.py index 00923c6c42..105571263f 100644 --- a/vault/models/res_config_settings.py +++ b/vault/models/res_config_settings.py @@ -8,3 +8,9 @@ class ResConfigSettings(models.TransientModel): _inherit = "res.config.settings" module_vault_share = fields.Boolean() + group_vault_export = fields.Boolean( + "Export Vaults", implied_group="vault.group_vault_export" + ) + group_vault_import = fields.Boolean( + "Import Vaults", implied_group="vault.group_vault_import" + ) diff --git a/vault/security/vault_security.xml b/vault/security/vault_security.xml new file mode 100644 index 0000000000..a810f29538 --- /dev/null +++ b/vault/security/vault_security.xml @@ -0,0 +1,13 @@ + + + + Allow to export vaults + + + + + Allow to import vaults + + + + diff --git a/vault/views/res_config_settings_views.xml b/vault/views/res_config_settings_views.xml index e71d94452c..691a50ee08 100644 --- a/vault/views/res_config_settings_views.xml +++ b/vault/views/res_config_settings_views.xml @@ -19,6 +19,28 @@ +
+
+ +
+
+
+
+
+
+ +
+
+
+
diff --git a/vault/views/vault_entry_views.xml b/vault/views/vault_entry_views.xml index a5b444a79f..738f520252 100644 --- a/vault/views/vault_entry_views.xml +++ b/vault/views/vault_entry_views.xml @@ -32,11 +32,13 @@ type="object" name="action_open_import_wizard" string="Import from file" + groups="vault.group_vault_import" />