Repository navigation
Conversation
tier.validation.exception.field_ids is a Many2many to ir.model.fields, and the model is readable by base.group_user (the validation logic checks exceptions as the acting user). Exposing field_ids in the exception list, form and search views without a groups= gate makes any non-Settings user who opens one of those views hit an Access Error: You are not allowed to access 'Fields' (ir.model.fields) records. The web client reads the co-records' display_name as the acting user, and a many2many triggers the ir.model.fields ACL read check (a many2one would be read with sudo and not raise). The exception config is Settings-level anyway -- only base.group_system can create/edit it -- so gate field_ids with groups="base.group_system" in the list, form and search views. Adds a test asserting field_ids is absent from the views for a base.group_user user and present for a Settings user.
Contributor
|
Hi @LoisRForgeFlow, |
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.
Problem
Opening the Tier Validation Exception list or form as a non-Settings internal user raises a hard Access Error:
tier.validation.exception.field_idsis aMany2manytoir.model.fields. The model's read ACL is granted tobase.group_user(access_tier_validation_exceptions_all) so the validation logic can check exceptions as the acting user. But the list, form and search views exposefield_idswith nogroups=, so the web client reads the co-records'display_nameas that user, which triggers their.model.fieldsACL read check and fails for anyone outsidebase.group_system.(A
Many2oneto the same model would be read withsudo()by the web client and would not raise — this is specific to the x2many path.)Fix
Only
base.group_systemcan create/edit exceptions (access_tier_validation_exceptions_settings), sofield_idsis effectively a Settings-level config field. Gate it withgroups="base.group_system"in the list, form and search views. Non-Settings users (who only have read for the internal exception check) no longer load the field, so no Access Error; Settings users are unaffected.Adds a test asserting
field_idsis absent from the exception views for abase.group_useruser and present for a Settings user.Notes
groups=gate.