Skip to content

spp_consent: viewer-tier wizard grants are inert-but-leaky; bulk wizard action binding lacks group_ids #466

Description

@gonzalesedwin1123

Split out of the review of #454, where the same defect blocked two new Tier-3 rows; the pre-existing Tier-2 rows carry it today. The PR author agreed the fix belongs at the source ("group_ids on the action is the right fix").

The defect

spp_consent/security/ir.model.access.csv grants read-only access on both consent wizard TransientModels to the Tier-2 viewer group:

  • line 6: access_spp_record_consent_wizard_viewerspp.record.consent.wizard, group_registry_viewer, 1,0,0,0
  • line 34: access_spp_bulk_record_consent_wizard_viewerspp.bulk.record.consent.wizard, group_registry_viewer, 1,0,0,0

Neither grant does what it presumably intended:

  1. The wizards are unreachable for viewers anyway. Both "Record Consent" stat buttons are gated groups="spp_registry.group_registry_officer,spp_registry.group_registry_manager" (spp_consent/views/registrant_view.xml:47,100), and read-without-create cannot open a wizard. The grant buys a viewer nothing usable.

  2. It surfaces a broken action. action_bulk_record_consent_wizard (spp_consent/wizard/bulk_record_consent.xml:133-139) binds to base.model_res_partner with binding_view_types: list and no group_ids. Odoo 19's ir.actions.actions.get_bindings() filters bindings by group_ids and then solely by ir.model.access.check(res_model, 'read') (ir_actions.py:168-178) — so every viewer-tier user sees "Bulk Record Consent" in the registrant list's Actions menu and gets an AccessError on click (no create permission).

  3. It leaks other users' in-flight wizard rows. Odoo 19 enforces no per-user isolation on transient models (Model._check_access has no transient branch; ir_rule._compute_domain likewise; the models_transient.py docstring claiming users "may only access the records they created" is stale). A model-level read grant therefore lets any holder search_read other users' un-vacuumed wizard rows — for the bulk wizard that exposes registrant_ids (which registrants an officer was about to process) and the free-text notes field.

Fix

  • Add group_ids (officer + manager, matching the buttons) to action_bulk_record_consent_wizard — the source fix, so ACL grants stop doubling as menu-visibility switches.
  • Drop the two viewer rows (same reasoning that kept them out of the Tier-3 set in fix(security): let Tier-3 registry read reach the registrant form's models #454; the changelog there records the rationale).
  • Usual version bump + HISTORY fragment for spp_consent.

Context: #454 (review thread on spp_consent/security/ir.model.access.csv), where the identical Tier-3 rows were dropped before merge.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions