diff --git a/v1/Application.cfc b/v1/Application.cfc index f7e7b8d..c077d4a 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.163"; /*$ git config --global --unset user.password*/ + variables.framework.docs.APIVersion="0.164"; /*$ git config --global --unset user.password*/ variables.framework.globalHeaders = structNew(); variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location"; diff --git a/v1/resources/instance.cfc b/v1/resources/instance.cfc index 629bf19..6fbd4e1 100644 --- a/v1/resources/instance.cfc +++ b/v1/resources/instance.cfc @@ -57,7 +57,20 @@ when coalesce(st.is_deleted,'false') = 'false' AND coalesce(st.is_suspended, 'false') = 'false' then 'running' when io.instance_uid IS NULL then 'not configured' else null end - ) as explained_status + ) as explained_status + + (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 + where d.contragent_id=k.contragent_id 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=v.resource_realm_type_id) as resource_realm_cnt + from instance e