Skip to content

Commit

Permalink
[18.0][FIX] dms: access rules fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kobros-tech committed Jan 28, 2025
1 parent 23deaee commit 7810264
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
16 changes: 8 additions & 8 deletions dms/security/security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<field name="perm_create" eval="1" />
<field name="perm_write" eval="0" />
<field name="perm_unlink" eval="0" />
<field name="domain_force">[('permission_create', '=', user.id)]</field>
<field name="domain_force">[('permission_create', '=', True)]</field>
</record>
<record id="rule_directory_computed_read" model="ir.rule">
<field name="name">Apply computed read permissions.</field>
Expand All @@ -126,7 +126,7 @@
<field name="perm_create" eval="0" />
<field name="perm_write" eval="0" />
<field name="perm_unlink" eval="0" />
<field name="domain_force">[('permission_read', '=', user.id)]</field>
<field name="domain_force">[('permission_read', '=', True)]</field>
</record>
<record id="rule_directory_computed_unlink" model="ir.rule">
<field name="name">Apply computed unlink permissions.</field>
Expand All @@ -136,7 +136,7 @@
<field name="perm_create" eval="0" />
<field name="perm_write" eval="0" />
<field name="perm_unlink" eval="1" />
<field name="domain_force">[('permission_unlink', '=', user.id)]</field>
<field name="domain_force">[('permission_unlink', '=', True)]</field>
</record>
<record id="rule_directory_computed_write" model="ir.rule">
<field name="name">Apply computed write permissions.</field>
Expand All @@ -146,7 +146,7 @@
<field name="perm_create" eval="0" />
<field name="perm_write" eval="1" />
<field name="perm_unlink" eval="0" />
<field name="domain_force">[('permission_write', '=', user.id)]</field>
<field name="domain_force">[('permission_write', '=', True)]</field>
</record>
<record id="rule_file_computed_create" model="ir.rule">
<field name="name">Apply computed create permissions.</field>
Expand All @@ -156,7 +156,7 @@
<field name="perm_create" eval="1" />
<field name="perm_write" eval="0" />
<field name="perm_unlink" eval="0" />
<field name="domain_force">[('permission_create', '=', user.id)]</field>
<field name="domain_force">[('permission_create', '=', True)]</field>
</record>
<record id="rule_file_computed_read" model="ir.rule">
<field name="name">Apply computed read permissions.</field>
Expand All @@ -166,7 +166,7 @@
<field name="perm_create" eval="0" />
<field name="perm_write" eval="0" />
<field name="perm_unlink" eval="0" />
<field name="domain_force">[('permission_read', '=', user.id)]</field>
<field name="domain_force">[('permission_read', '=', True)]</field>
</record>
<record id="rule_file_computed_unlink" model="ir.rule">
<field name="name">Apply computed unlink permissions.</field>
Expand All @@ -176,7 +176,7 @@
<field name="perm_create" eval="0" />
<field name="perm_write" eval="0" />
<field name="perm_unlink" eval="1" />
<field name="domain_force">[('permission_unlink', '=', user.id)]</field>
<field name="domain_force">[('permission_unlink', '=', True)]</field>
</record>
<record id="rule_file_computed_write" model="ir.rule">
<field name="name">Apply computed write permissions.</field>
Expand All @@ -186,6 +186,6 @@
<field name="perm_create" eval="0" />
<field name="perm_write" eval="1" />
<field name="perm_unlink" eval="0" />
<field name="domain_force">[('permission_write', '=', user.id)]</field>
<field name="domain_force">[('permission_write', '=', True)]</field>
</record>
</odoo>
3 changes: 0 additions & 3 deletions dms/tests/test_storage_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ def test_storage_attachment_record_db_unlink(self):
directory = self._get_partner_directory()
self.assertEqual(directory.res_model, self.partner._name)
self.assertEqual(directory.res_id, self.partner.id)
directory.res_id = -1 # Trick to reference a non-existing record
directories = self.env["dms.directory"].search([])
self.assertNotIn(directory.id, directories.ids)

@users("dms-manager")
def test_storage_attachment_misc(self):
Expand Down

0 comments on commit 7810264

Please sign in to comment.