-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
[15.0][FIX] hr_employee_document: Remove record rules from hr.employee to avoid side effects.. #1271
[15.0][FIX] hr_employee_document: Remove record rules from hr.employee to avoid side effects.. #1271
Conversation
You have to put the steps to reproduce the problem in the commit message. Apart from that, why that ACLs was there? (isn't they record rules, not ACL?) Seeing a bit the code, it seems you are solving it acting at code level. Please explain all of this in the commit message, docstring, etc. |
6e7570c
to
e67de4b
Compare
Sorry, changed the commit message and explained a use case. |
_inherit = "ir.attachment" | ||
|
||
@api.model | ||
def _search( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security shouldn't be handled in _search
method. This is a security hole, as you can browse directly some random records.
243dd84
to
f37ef07
Compare
I have changed the approach to try to solve the problem in another way, although there is still some detail to be solved, what do you think about this way? |
f37ef07
to
0a978c0
Compare
0a978c0
to
bc586f9
Compare
…void side effects. The purpose of this module is to allow a basic user (without hr permissions) to view the attachments related to his employee (hr.employee). By default a basic user cannot access to hr.employee model and therefore cannot see the attachments (ir.attachment) linked to it. This change overrides some things to allow the user's employee attachments to be displayed. TT44536
bc586f9
to
5ec7364
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
This PR has the |
/ocabot merge major |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 2811e28. Thanks a lot for contributing to OCA. ❤️ |
Remove record rules from hr.employee to avoid side effects.
Example of use case:
parent_id
) is defined.hr.expense.sheet
).hr.employee
) because the record rules that this module had added do not allow access to that record.Solution:
This change overrides some things to allow the user's employee attachments to be displayed.
Please @pedrobaeza can you review it?
@Tecnativa TT44536