From 5407b604ae66971a6a2a290eb5c45eb070a02b9a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 1 Nov 2025 15:56:42 +0300 Subject: [PATCH] 156 svc.resource_realm_cnt --- v1/Application.cfc | 2 +- v1/resources/svc_ls.cfc | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/v1/Application.cfc b/v1/Application.cfc index c7ee057..5a96ab9 100644 --- a/v1/Application.cfc +++ b/v1/Application.cfc @@ -51,7 +51,7 @@ //variables.framework.docs={}; variables.framework.docs.APIName="svc-api"; - variables.framework.docs.APIVersion="0.154"; /*$ git config --global --unset user.password*/ + variables.framework.docs.APIVersion="0.156"; /*$ git config --global --unset user.password*/ variables.framework.globalHeaders = structNew(); variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location"; diff --git a/v1/resources/svc_ls.cfc b/v1/resources/svc_ls.cfc index dc55dee..29e2bf5 100644 --- a/v1/resources/svc_ls.cfc +++ b/v1/resources/svc_ls.cfc @@ -73,6 +73,19 @@ s.icon_src s.descr s.man + (select count(distinct r.resource_realm) + from resource_realm r + join resource_realm_access a on ( + r.resource_realm_id=a.resource_realm_id + AND (a.contract_id IN ( + select contract_id + from contract d + join contragent z on (d.contragent_id=z.contragent_id) + where z.external_uid= + AND NOT d.is_closed + ) OR a.contract_id=0) /*0 means access to any contract*/ + AND a.is_enabled) + where r.resource_realm_type_id=s.resource_realm_type_id) as resource_realm_cnt to_char(s.dt_created, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_created to_char(s.dt_updated, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZHTZM') as dt_updated