Skip to content

[19.0][FIX] base_tier_validation: no access to reviews for portal and public users - #85

Open
bosd wants to merge 3 commits into
OCA:19.0from
bosd:19.0-fix-base_tier_validation-portal-access
Open

bosd wants to merge 3 commits into
OCA:19.0from
bosd:19.0-fix-base_tier_validation-portal-access

Conversation

@bosd

@bosd bosd commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

The 17.0 migration replaced the access rules without a group on tier.review and tier.definition by one rule per group, and in doing so gave portal and public users read access to both. Apart from the multi-company rule there is no record rule on them, so a portal user can read every review (reviewers, comments) and every definition of their company through RPC, not only those of their own documents.

Portal pages do not need it: viewing, printing, chatting on and signing a document all work on the document with sudo. This PR removes the four rules and adds tests:

  • base_tier_validation: portal and public users cannot read reviews or definitions.
  • sale_tier_validation: a portal customer, and a public user with the access token, can view, discuss and sign a quotation that has reviews.
  • purchase_tier_validation: a portal vendor, and a public user with the access token, can view and print a purchase order that has reviews.

I also ran Odoo's own portal tests for sale (TestAccessRightsControllers, TestSalesControllers, TestSaleSignature) and invoices (TestPortalAttachment) with the tier modules installed.

18.0 and 17.0 have the same rules; I can backport once this one is reviewed.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @LoisRForgeFlow,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added mod:base_tier_validation Module base_tier_validation series:19.0 mod:purchase_tier_validation Module purchase_tier_validation mod:sale_tier_validation Module sale_tier_validation labels Oct 6, 2026
@bosd
bosd force-pushed the 19.0-fix-base_tier_validation-portal-access branch from 10c5671 to ae15154 Compare October 6, 2026 15:06
@bosd bosd added the bug Something isn't working label Oct 6, 2026
bosd added 3 commits October 7, 2026 10:23
…c users

The 17.0 migration replaced the group-less access rules on tier.review
and tier.definition by one rule per group, and so gave portal and
public users read access to them. Tier validation has no record rule
besides the multi-company one, so a portal user could read every
review (reviewers, comments) and every definition of the company
through RPC, not only those of their own documents.

Portal pages and portal actions (view, PDF, chatter, sign) work on the
document with sudo and do not need these rules.
A portal customer, or a public user with the access token, can view,
discuss and sign a quotation that has reviews, while they cannot read
the reviews themselves.
A portal vendor, or a public user with the access token, can view a
purchase order that has reviews, while they cannot read the reviews
themselves.
@bosd
bosd force-pushed the 19.0-fix-base_tier_validation-portal-access branch from ae15154 to b27effc Compare October 7, 2026 08:27

@Pani-k-folk Pani-k-folk left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. I'll apply the same changes in #94 (20.0 migration) after this PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working mod:base_tier_validation Module base_tier_validation mod:purchase_tier_validation Module purchase_tier_validation mod:sale_tier_validation Module sale_tier_validation series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants