From d62fcd45cfbe241d2a2a0424d4421846ad7d5904 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Wed, 20 Mar 2024 10:06:45 +0100 Subject: [PATCH] conditional RBAC update for debitor --- .../resources/db/changelog/273-hs-office-debitor-rbac.sql | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/resources/db/changelog/273-hs-office-debitor-rbac.sql b/src/main/resources/db/changelog/273-hs-office-debitor-rbac.sql index bb551a0a..64aaeb53 100644 --- a/src/main/resources/db/changelog/273-hs-office-debitor-rbac.sql +++ b/src/main/resources/db/changelog/273-hs-office-debitor-rbac.sql @@ -113,9 +113,11 @@ declare newRefundBankAccount hs_office_bankaccount; begin - delete from rbacgrants g where g.grantedbytriggerof = OLD.uuid; - - call buildRbacSystemForHsOfficeDebitor(NEW); + if NEW.refundbankaccountuuid <> OLD.refundbankaccountuuid + or NEW.debitorreluuid <> OLD.debitorreluuid then + delete from rbacgrants g where g.grantedbytriggerof = OLD.uuid; + call buildRbacSystemForHsOfficeDebitor(NEW); + end if; end; $$; /*