From d0bc468ce7a388c5f0bd86e94fa83eae341569b0 Mon Sep 17 00:00:00 2001 From: xbgmsharp Date: Wed, 17 Jan 2024 20:18:40 +0100 Subject: [PATCH] Allow anonymous access for complete timelapse --- initdb/02_3_2_signalk_public_functions.sql | 2 +- initdb/02_5_signalk_api_deps.sql | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/initdb/02_3_2_signalk_public_functions.sql b/initdb/02_3_2_signalk_public_functions.sql index ffed26b..209fb5e 100644 --- a/initdb/02_3_2_signalk_public_functions.sql +++ b/initdb/02_3_2_signalk_public_functions.sql @@ -1867,7 +1867,7 @@ BEGIN END IF; -- Check if boat name match public_vessel name boat := '^' || _pvessel || '$'; - IF _ptype ~ '^public_(logs|timelapse)$' AND _pid IS NOT NULL THEN + IF _ptype ~ '^public_(logs|timelapse)$' AND _pid > 0 THEN WITH log as ( SELECT vessel_id from api.logbook l where l.id = _pid ) diff --git a/initdb/02_5_signalk_api_deps.sql b/initdb/02_5_signalk_api_deps.sql index e8002ac..b5f1a42 100644 --- a/initdb/02_5_signalk_api_deps.sql +++ b/initdb/02_5_signalk_api_deps.sql @@ -316,7 +316,8 @@ BEGIN RETURN False; END IF; - IF _type ~ '^public_(logs|timelapse)$' AND _id IS NOT NULL THEN + RAISE WARNING '-> ispublic_fn _type [%], _id [%]', _type, _id; + IF _type ~ '^public_(logs|timelapse)$' AND _id > 0 THEN WITH log as ( SELECT vessel_id from api.logbook l where l.id = _id )