From 21a45197436fb646716a2e1bbaaf38e23cbca2a2 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Mon, 26 Sep 2022 09:26:22 +0200 Subject: [PATCH] code cleanup in partner sql files --- .../db/changelog/220-hs-office-partner.sql | 2 +- .../db/changelog/223-hs-office-partner-rbac.sql | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/resources/db/changelog/220-hs-office-partner.sql b/src/main/resources/db/changelog/220-hs-office-partner.sql index e6f3e080..04b8f402 100644 --- a/src/main/resources/db/changelog/220-hs-office-partner.sql +++ b/src/main/resources/db/changelog/220-hs-office-partner.sql @@ -6,7 +6,7 @@ create table if not exists hs_office_partner ( - uuid uuid unique references RbacObject (uuid) initially deferred, -- on delete cascade + uuid uuid unique references RbacObject (uuid) initially deferred, personUuid uuid not null references hs_office_person(uuid), contactUuid uuid not null references hs_office_contact(uuid), registrationOffice varchar(96), diff --git a/src/main/resources/db/changelog/223-hs-office-partner-rbac.sql b/src/main/resources/db/changelog/223-hs-office-partner-rbac.sql index b004e965..a55f93f2 100644 --- a/src/main/resources/db/changelog/223-hs-office-partner-rbac.sql +++ b/src/main/resources/db/changelog/223-hs-office-partner-rbac.sql @@ -50,7 +50,7 @@ begin beneathRole(globalAdmin()) ); - -- the admin role with full access for the global admins + -- the admin role with full access for owner adminRole = createRole( hsOfficePartnerAdmin(NEW), grantingPermissions(forObjectUuid => NEW.uuid, permitOps => array ['edit']), @@ -61,8 +61,13 @@ begin perform createRole( hsOfficePartnerTenant, grantingPermissions(forObjectUuid => NEW.uuid, permitOps => array ['view']), - beneathRoles(array[hsOfficePartnerAdmin(NEW), hsOfficePersonAdmin(newPerson), hsOfficeContactAdmin(newContact)]), - withSubRoles(array[hsOfficePersonTenant(newPerson), hsOfficeContactTenant(newContact)]) + beneathRoles(array[ + hsOfficePartnerAdmin(NEW), + hsOfficePersonAdmin(newPerson), + hsOfficeContactAdmin(newContact)]), + withSubRoles(array[ + hsOfficePersonTenant(newPerson), + hsOfficeContactTenant(newContact)]) ); elsif TG_OP = 'UPDATE' then @@ -142,7 +147,7 @@ call generateRbacRestrictedView('hs_office_partner', -- ============================================================================ ---changeset hs-office-partner-rbac-NEW-CONTACT:1 endDelimiter:--// +--changeset hs-office-partner-rbac-NEW-PARTNER:1 endDelimiter:--// -- ---------------------------------------------------------------------------- /* Creates a global permission for new-partner and assigns it to the hostsharing admins role.