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

[FIX] mail: allow bypassing message attachments check #164874

Conversation

reth-odoo
Copy link
Contributor

@reth-odoo reth-odoo commented May 8, 2024

In some cases it may be necessary to bypass the check for attachments on other users messages
if the attachment from the message is used for another purpose without being copied.

We add a method to filter out the attachments for that check.

Additional changes:

  • Admins can delete attachments from message in the UI again
  • Check returns True instead of None when it succeeds, to match its parent
  • AccessError is raised with a cause so that we can detect if it was raised because of the message check

issue introduced in odoo/odoo#4c4e63f01aefa01c2377f15f2020485cb0f7e4da

task-3519815

Some modules may use attachments from mail messages directly.

We want to allow to bypass the check on message attachments
if there is a need for it.

It will immediately be used for the enterprise documents app.

Also return True instead of None in the override of `check`
to match the behavior of the parent.

Also reword the error message to convey writing is also forbidden.

task-3519815
@C3POdoo C3POdoo requested review from a team May 8, 2024 07:36
@robodoo
Copy link
Contributor

robodoo commented May 8, 2024

Pull request status dashboard.

@reth-odoo reth-odoo changed the title [FIX] documents: Allow editing mail attachments from emails [FIX] mail: allow bypassing message attachments check May 8, 2024
Administrators are technically allowed to delete attachments from any message.

However the UI does not reflect that since [1]

1: 4c4e63f

task-3519815
@reth-odoo reth-odoo force-pushed the 15.0-documents-fix-mail-attachment-access-rights-reth branch from 44cdbeb to 671a907 Compare May 8, 2024 07:47
@C3POdoo C3POdoo added the RD research & development, internal work label May 8, 2024
@reth-odoo
Copy link
Contributor Author

Closed in favor of #164894

@reth-odoo reth-odoo closed this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants