[19.0][FIX] impersonate_login: preserve attachment creator ownership#907
Open
gdgellatly wants to merge 1 commit intoOCA:19.0from
Open
[19.0][FIX] impersonate_login: preserve attachment creator ownership#907gdgellatly wants to merge 1 commit intoOCA:19.0from
gdgellatly wants to merge 1 commit intoOCA:19.0from
Conversation
Avoid rewriting create_uid/write_uid on ir.attachment during impersonation. Temporary report/email attachments may be created without res_model/res_id and core access checks rely on creator ownership for read access in that case.
Author
|
This came up in testing a workflow that automatically popped a mail template with an attachment, purchases specifically. I tried to make real narrow but I either got recursion errors or same access error. |
Author
|
I am just wondering if my experience is a symptom of #904 and the storing of mail messages |
Contributor
|
Hi @Kev-Roche, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create_uid/write_uidonir.attachmentduring impersonation inimpersonate_login.res_model/res_id).Options considered
ir.attachmentfrom impersonatecreate_uid/write_uidrewriting inbaseoverrides.ir.attachmentownership checks, no security rule override.ir.attachment._check_accessoverride to whitelist only orphan attachments created byimpersonate_from_uidin impersonated sessions.Failures observed during investigation
Sorry, you are not allowed to access this document ... Records: ir.attachment(...), User: <impersonated uid>_check_accessoverride approach:RecursionError: maximum recursion depth exceeded