Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locked attachments can still be deleted from the chatter of an object #381

Open
lorenzomorandini opened this issue Dec 9, 2024 · 5 comments
Labels

Comments

@lorenzomorandini
Copy link

lorenzomorandini commented Dec 9, 2024

Module

DMS

Describe the bug

Locking an attachment of an object (example an attachment of an invoice) thru DMS still allows for the attachment to be deleted from the chatter of the invoice.

Expected behavior
Deleting / modifying the attachment from the invoice should be blocked as well.

Tested on Odoo 16.

@kobros-tech
Copy link

could you review this PR #385 to see if the issue is solved or not?

@victoralmau
Copy link
Member

According to the defined rule https://github.com/OCA/dms/blob/16.0/dms/security/security.xml#L63 users will be able to delete files if they have locked them themselves (regardless of how they try to delete them).

@pedrobaeza
Copy link
Member

Closing this as no issue then.

@lorenzomorandini
Copy link
Author

Sorry, my bad for not being clear enough. The problem is that:

  • User A blocks a file
  • User B can not delete it thru DMS but can delete it thru attachment

User A is an administrator, user B is a normal DMS user.

@pedrobaeza
Copy link
Member

OK, reopening it.

@pedrobaeza pedrobaeza reopened this Mar 25, 2025
victoralmau added a commit to Tecnativa/dms that referenced this issue Mar 28, 2025
When deleting an attachment, an attempt should be made to delete the linked file, causing an error if it is locked.
Do not show the Delete/Archive/Unarchive option on files if it is locked and you cannot unlock it.

Fixes OCA#381
victoralmau added a commit to Tecnativa/dms that referenced this issue Mar 28, 2025
When deleting an attachment, an attempt should be made to delete the linked file, causing an error if it is locked.
Do not show the Delete/Archive/Unarchive option on files if it is locked and you cannot unlock it.

Fixes OCA#381
victoralmau added a commit to Tecnativa/dms that referenced this issue Mar 28, 2025
When deleting an attachment, an attempt should be made to delete the linked file, causing an error if it is locked.
Do not show the Delete/Archive/Unarchive option on files if it is locked and you cannot unlock it.

Fixes OCA#381
victoralmau added a commit to Tecnativa/dms that referenced this issue Mar 31, 2025
When deleting an attachment, an attempt should be made to delete the linked file, causing an error if it is locked.
Do not show the Delete/Archive/Unarchive option on files if it is locked and you cannot unlock it.

Fixes OCA#381
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants