Skip to content

Conversation

@Williambraecky
Copy link
Contributor

Before this commit users were not able to edit their settings if they
had a linked employee for a company that was not currently active for
them.
This is due to the fact that since the employee_ids field is considered
safe to read/write by your own user the fields were loaded in sudo and
thus bypassed the security rules that were meant to prevent that issue.
The security rule is now enforced as a domain on the employee_ids.

Reverts commit 0e12620
from PR odoo#79472

TaskId-2715341
Before this commit users were not able to edit their settings if they
had a linked employee for a company that was not currently active for
them.
This is due to the fact that since the employee_ids field is considered
`safe` to read/write by your own user the fields were loaded in sudo and
thus bypassed the security rules that were meant to prevent that issue.
The security rule is now enforced as a domain on the `employee_ids`.

TaskId-2715341
@robodoo
Copy link
Contributor

robodoo commented Dec 15, 2021

Pull request status dashboard

@C3POdoo C3POdoo added the RD research & development, internal work label Dec 15, 2021
@kbapt
Copy link
Contributor

kbapt commented Dec 17, 2021

@robodoo rebase-ff r+

@robodoo
Copy link
Contributor

robodoo commented Dec 17, 2021

Merge method set to rebase and fast-forward

robodoo pushed a commit that referenced this pull request Dec 17, 2021
Reverts commit 0e12620
from PR #79472

TaskId-2715341

Part-of: #81474
@robodoo robodoo closed this in b5b105e Dec 17, 2021
@Williambraecky Williambraecky deleted the 15.0-fix-my-profile-edit-wbr branch December 17, 2021 15:29
@robodoo robodoo temporarily deployed to merge December 17, 2021 15:29 Inactive
Williambraecky added a commit to odoo-dev/odoo that referenced this pull request Jun 24, 2022
Backport of odoo#81474
Before odoo#86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.
robodoo pushed a commit that referenced this pull request Jun 24, 2022
Backport of #81474
Before #86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

closes #94558

Signed-off-by: Kevin Baptiste <[email protected]>
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Jun 24, 2022
Backport of odoo#81474
Before odoo#86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

X-original-commit: 90cec40
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Jun 24, 2022
Backport of odoo#81474
Before odoo#86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

X-original-commit: 90cec40
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Jun 24, 2022
Backport of odoo#81474
Before odoo#86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

X-original-commit: 90cec40
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Jun 24, 2022
Backport of odoo#81474
Before odoo#86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

X-original-commit: 90cec40
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Jun 24, 2022
Backport of odoo#81474
Before odoo#86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

X-original-commit: 90cec40
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Jun 24, 2022
Backport of odoo#81474
Before odoo#86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

X-original-commit: 90cec40
robodoo pushed a commit that referenced this pull request Jun 25, 2022
Backport of #81474
Before #86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

closes #94611

X-original-commit: 90cec40
Signed-off-by: Kevin Baptiste <[email protected]>
Signed-off-by: William Braeckman (wbr) <[email protected]>
robodoo pushed a commit that referenced this pull request Jun 25, 2022
Backport of #81474
Before #86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

closes #94607

X-original-commit: 90cec40
Signed-off-by: Kevin Baptiste <[email protected]>
Signed-off-by: William Braeckman (wbr) <[email protected]>
robodoo pushed a commit that referenced this pull request Jun 25, 2022
Backport of #81474
Before #86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

closes #94602

X-original-commit: 90cec40
Signed-off-by: Kevin Baptiste <[email protected]>
Signed-off-by: William Braeckman (wbr) <[email protected]>
robodoo pushed a commit that referenced this pull request Jun 25, 2022
Backport of #81474
Before #86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

closes #94592

X-original-commit: 90cec40
Signed-off-by: Kevin Baptiste <[email protected]>
Signed-off-by: William Braeckman (wbr) <[email protected]>
robodoo pushed a commit that referenced this pull request Jun 25, 2022
Backport of #81474
Before #86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

closes #94615

X-original-commit: 90cec40
Signed-off-by: Kevin Baptiste <[email protected]>
Signed-off-by: William Braeckman (wbr) <[email protected]>
robodoo pushed a commit that referenced this pull request Jun 25, 2022
Backport of #81474
Before #86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

closes #94618

X-original-commit: 90cec40
Signed-off-by: Kevin Baptiste <[email protected]>
Signed-off-by: William Braeckman (wbr) <[email protected]>
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.

4 participants