Skip to content

Commit

Permalink
[IMP] vault: Add new groups to allow importing/exporting secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosRoca13 committed Oct 2, 2023
1 parent 42f6cb9 commit a7c49ef
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions vault/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions vault/models/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
13 changes: 13 additions & 0 deletions vault/security/vault_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="group_vault_export" model="res.groups">
<field name="name">Allow export vaults</field>
<field name="category_id" ref="base.module_category_hidden" />
<field name="users" eval="[(4, ref('base.user_admin'))]" />
</record>
<record id="group_vault_import" model="res.groups">
<field name="name">Allow import vaults</field>
<field name="category_id" ref="base.module_category_hidden" />
<field name="users" eval="[(4, ref('base.user_admin'))]" />
</record>
</odoo>
2 changes: 2 additions & 0 deletions vault/views/vault_entry_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
type="object"
name="action_open_import_wizard"
string="Import from file"
groups="vault.group_vault_import"
/>
<button
type="object"
name="action_open_export_wizard"
string="Export to file"
groups="vault.group_vault_export"
/>
</header>
<sheet>
Expand Down
3 changes: 3 additions & 0 deletions vault/views/vault_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,19 @@
type="object"
name="action_open_import_wizard"
string="Import from file"
groups="vault.group_vault_import"
/>
<button
type="object"
name="action_open_export_wizard"
string="Export to file"
groups="vault.group_vault_export"
/>
<button
type="object"
name="action_open_export_wizard"
string="Export to file"
groups="vault.group_vault_export"
/>
<button name="vault_verify" string="Verify" />
<button
Expand Down

0 comments on commit a7c49ef

Please sign in to comment.