introduce-booking-module #41
@ -117,7 +117,11 @@ public class HsBookingItemEntity implements Stringifyable, RbacObject {
|
|||||||
|
|
||||||
public static RbacView rbac() {
|
public static RbacView rbac() {
|
||||||
return rbacViewFor("bookingItem", HsBookingItemEntity.class)
|
return rbacViewFor("bookingItem", HsBookingItemEntity.class)
|
||||||
.withIdentityView(SQL.projection("caption")) // FIXME: use memberNumber:caption
|
.withIdentityView(SQL.query("""
|
||||||
|
SELECT i.uuid as uuid, d.idName || ':' || i.caption as idName
|
||||||
|
FROM hs_booking_item i
|
||||||
|
JOIN hs_office_debitor_iv d ON d.uuid = i.debitorUuid
|
||||||
|
"""))
|
||||||
.withRestrictedViewOrderBy(SQL.expression("validity"))
|
.withRestrictedViewOrderBy(SQL.expression("validity"))
|
||||||
.withUpdatableColumns("version", "validity", "resources")
|
.withUpdatableColumns("version", "validity", "resources")
|
||||||
|
|
||||||
|
@ -107,14 +107,14 @@ do language plpgsql $$
|
|||||||
WHERE type in ('DEBITOR') -- TODO.rbac: currently manually patched, needs to be generated
|
WHERE type in ('DEBITOR') -- TODO.rbac: currently manually patched, needs to be generated
|
||||||
LOOP
|
LOOP
|
||||||
call grantPermissionToRole(
|
call grantPermissionToRole(
|
||||||
createPermission(row.uuid, 'INSERT', 'hs_booking_item'),
|
createPermission(row.uuid, 'INSERT', 'hs_booking_item'),
|
||||||
hsOfficeRelationADMIN(row));
|
hsOfficeRelationADMIN(row));
|
||||||
END LOOP;
|
END LOOP;
|
||||||
END;
|
END;
|
||||||
$$;
|
$$;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Adds hs_booking_item INSERT permission to specified roleNSERT permission to specified role of new hs_office_relation rows.
|
Adds hs_booking_item INSERT permission to specified role of new hs_office_relation rows.
|
||||||
*/
|
*/
|
||||||
create or replace function hs_booking_item_hs_office_relation_insert_tf()
|
create or replace function hs_booking_item_hs_office_relation_insert_tf()
|
||||||
returns trigger
|
returns trigger
|
||||||
@ -175,10 +175,12 @@ create trigger hs_booking_item_insert_permission_check_tg
|
|||||||
--changeset hs-booking-item-rbac-IDENTITY-VIEW:1 endDelimiter:--//
|
--changeset hs-booking-item-rbac-IDENTITY-VIEW:1 endDelimiter:--//
|
||||||
-- ----------------------------------------------------------------------------
|
-- ----------------------------------------------------------------------------
|
||||||
|
|
||||||
call generateRbacIdentityViewFromProjection('hs_booking_item',
|
call generateRbacIdentityViewFromQuery('hs_booking_item',
|
||||||
$idName$
|
$idName$
|
||||||
caption
|
SELECT i.uuid as uuid, d.idName || ':' || i.caption as idName
|
||||||
$idName$);
|
FROM hs_booking_item i
|
||||||
|
JOIN hs_office_debitor_iv d ON d.uuid = i.debitorUuid
|
||||||
|
$idName$);
|
||||||
--//
|
--//
|
||||||
|
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
@ -186,7 +188,7 @@ call generateRbacIdentityViewFromProjection('hs_booking_item',
|
|||||||
-- ----------------------------------------------------------------------------
|
-- ----------------------------------------------------------------------------
|
||||||
call generateRbacRestrictedView('hs_booking_item',
|
call generateRbacRestrictedView('hs_booking_item',
|
||||||
$orderBy$
|
$orderBy$
|
||||||
caption
|
validity
|
||||||
$orderBy$,
|
$orderBy$,
|
||||||
$updates$
|
$updates$
|
||||||
version = new.version,
|
version = new.version,
|
||||||
|
Loading…
Reference in New Issue
Block a user