diff --git a/spp_grm_cel/README.rst b/spp_grm_cel/README.rst index 6954d46f9..8c5e1aafe 100644 --- a/spp_grm_cel/README.rst +++ b/spp_grm_cel/README.rst @@ -124,6 +124,20 @@ Dependencies Changelog ========= +19.0.2.0.1 +~~~~~~~~~~ + +- fix(security): restrict GRM routing and escalation rules to GRM staff. + Portal users no longer hold write/create on ``spp.grm.routing.rule`` + and ``spp.grm.escalation.rule``; these models carry no record rules, + so the access-control entry was the only boundary. Because portal + grievance submission runs sudo, a portal-authored rule previously + executed its CEL condition and actions as superuser. +- fix(grm): increment the escalation counter with elevated rights, + matching the routing rule's ``match_count`` update, so a caller + without write access cannot leave an escalation applied half-way + (notification sent and case created, counter and chatter missing). + 19.0.2.0.0 ~~~~~~~~~~ diff --git a/spp_grm_cel/__manifest__.py b/spp_grm_cel/__manifest__.py index 5e63a8773..5678cb426 100644 --- a/spp_grm_cel/__manifest__.py +++ b/spp_grm_cel/__manifest__.py @@ -2,7 +2,7 @@ { "name": "OpenSPP GRM: CEL Rules", "summary": "CEL-based routing and escalation rules for GRM tickets", - "version": "19.0.2.0.0", + "version": "19.0.2.0.1", "license": "LGPL-3", "development_status": "Production/Stable", "maintainers": ["jeremi", "gonzalesedwin1123", "emjay0921"], diff --git a/spp_grm_cel/models/grm_escalation_rule.py b/spp_grm_cel/models/grm_escalation_rule.py index 6c5310472..c4c1547a1 100644 --- a/spp_grm_cel/models/grm_escalation_rule.py +++ b/spp_grm_cel/models/grm_escalation_rule.py @@ -345,7 +345,8 @@ def apply_escalation(self, ticket): self._create_case_from_ticket(ticket) # Update escalation count - self.write({"escalation_count": self.escalation_count + 1}) + # nosemgrep: semgrep.odoo-sudo-without-context -- counter update needs sudo + self.sudo().write({"escalation_count": self.escalation_count + 1}) # Post message to chatter ticket.message_post( diff --git a/spp_grm_cel/readme/HISTORY.md b/spp_grm_cel/readme/HISTORY.md index 4aaf9afef..33c4526f0 100644 --- a/spp_grm_cel/readme/HISTORY.md +++ b/spp_grm_cel/readme/HISTORY.md @@ -1,3 +1,14 @@ +### 19.0.2.0.1 + +- fix(security): restrict GRM routing and escalation rules to GRM staff. Portal users no longer + hold write/create on ``spp.grm.routing.rule`` and ``spp.grm.escalation.rule``; these models + carry no record rules, so the access-control entry was the only boundary. Because portal + grievance submission runs sudo, a portal-authored rule previously executed its CEL condition + and actions as superuser. +- fix(grm): increment the escalation counter with elevated rights, matching the routing rule's + ``match_count`` update, so a caller without write access cannot leave an escalation applied + half-way (notification sent and case created, counter and chatter missing). + ### 19.0.2.0.0 - Initial migration to OpenSPP2 diff --git a/spp_grm_cel/security/ir.model.access.csv b/spp_grm_cel/security/ir.model.access.csv index 9f37958ee..5520d43c2 100644 --- a/spp_grm_cel/security/ir.model.access.csv +++ b/spp_grm_cel/security/ir.model.access.csv @@ -3,9 +3,9 @@ access_spp_grm_routing_rule_viewer,GRM Routing Rule Viewer Access,model_spp_grm_ access_spp_grm_routing_rule_officer,GRM Routing Rule Officer Access,model_spp_grm_routing_rule,spp_grm.group_grm_officer,1,1,1,0 access_spp_grm_routing_rule_manager,GRM Routing Rule Manager Access,model_spp_grm_routing_rule,spp_grm.group_grm_manager,1,1,1,1 access_spp_grm_routing_rule_base_user,GRM Routing Rule Base User Access,model_spp_grm_routing_rule,base.group_user,1,0,0,0 -access_spp_grm_routing_rule_portal_user,GRM Routing Rule Portal User Access,model_spp_grm_routing_rule,base.group_portal,1,1,1,0 +access_spp_grm_routing_rule_portal_user,GRM Routing Rule Portal User Access,model_spp_grm_routing_rule,base.group_portal,1,0,0,0 access_spp_grm_escalation_rule_viewer,GRM Escalation Rule Viewer Access,model_spp_grm_escalation_rule,spp_grm.group_grm_viewer,1,0,0,0 access_spp_grm_escalation_rule_officer,GRM Escalation Rule Officer Access,model_spp_grm_escalation_rule,spp_grm.group_grm_officer,1,1,1,0 access_spp_grm_escalation_rule_manager,GRM Escalation Rule Manager Access,model_spp_grm_escalation_rule,spp_grm.group_grm_manager,1,1,1,1 access_spp_grm_escalation_rule_base_user,GRM Escalation Rule Base User Access,model_spp_grm_escalation_rule,base.group_user,1,0,0,0 -access_spp_grm_escalation_rule_portal_user,GRM Escalation Rule Portal User Access,model_spp_grm_escalation_rule,base.group_portal,1,1,1,0 +access_spp_grm_escalation_rule_portal_user,GRM Escalation Rule Portal User Access,model_spp_grm_escalation_rule,base.group_portal,1,0,0,0 diff --git a/spp_grm_cel/static/description/index.html b/spp_grm_cel/static/description/index.html index 84a29ba67..ee4c6ccb1 100644 --- a/spp_grm_cel/static/description/index.html +++ b/spp_grm_cel/static/description/index.html @@ -511,6 +511,21 @@