099 resourceRealm fix

This commit is contained in:
msyu
2025-04-23 13:44:38 +03:00
parent a97a4422cc
commit fbb0d2ae5c
3 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -51,7 +51,7 @@
//variables.framework.docs={}; //variables.framework.docs={};
variables.framework.docs.APIName="Deck API"; variables.framework.docs.APIName="Deck API";
variables.framework.docs.APIVersion="0.098"; variables.framework.docs.APIVersion="0.099";
variables.framework.globalHeaders = structNew(); variables.framework.globalHeaders = structNew();
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location"; variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
@@ -389,7 +389,7 @@
</cfquery> </cfquery>
<cfif local.qCheckResourceRealmAccess.recordCount EQ 0> <cfif local.qCheckResourceRealmAccess.recordCount EQ 0>
<cfthrow message="Resource realm specified in CFS param is not available for the current contract" detail="CFS resource realm #arguments.paramValue# unawailable. Instance operation UID #arguments.instanceOperationUid#. Contract ID #arguments.contractId#"/> <cfthrow message="Resource realm specified in CFS param is not available for the current contract" detail="CFS resource realm #arguments.paramValue# unawailable. Instance operation UID #arguments.instanceOperationUid#. Contract ID #local.qContract.contract_id#"/>
</cfif> </cfif>
</cffunction> </cffunction>
+8 -6
View File
@@ -340,14 +340,15 @@
<cffunction name="checkCfsResourceRealmAccess"> <cffunction name="checkCfsResourceRealmAccess">
<cfargument name="instanceOperationUid" type="guid"> <cfargument name="instanceOperationUid" type="guid">
<cfset var local={}/> <cfset var local={}/>
<!--- структура cfs и rfs параметров отличается, поэтому селекты разные ---> <!--- Проверяем наличие CFS параметра resourceRealm у операции инстанса (не глядя на то, определен он или нет у операции сервиса) --->
<!--- структура cfs и rfs параметров отличается, поэтому селекты разные --->
<cfquery name="local.qParam"> <cfquery name="local.qParam">
select sop.svc_operation_cfs_param select sop.svc_operation_cfs_param
from instance_operation io from instance_operation io
join instance e on (io.instance_uid=e.instance_uid) join instance e on (io.instance_uid=e.instance_uid)
join svc_operation so on (e.service_id=so.svc_id) join svc_operation so on (e.service_id=so.svc_id AND io.operation=so.operation)
join svc_operation_cfs_param sop on (so.svc_operation_id=sop.svc_operation_id) join svc_operation_cfs_param sop on (so.svc_operation_id=sop.svc_operation_id)
where io.instance_operation_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceOperationUid#" null=#!isValid("guid",arguments.instanceOperationUid)#/> where io.instance_operation_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceOperationUid#" null=#!isValid("guid",arguments.instanceOperationUid)#/>
AND LOWER(sop.svc_operation_cfs_param)=LOWER('resourceRealm') AND LOWER(sop.svc_operation_cfs_param)=LOWER('resourceRealm')
@@ -374,6 +375,7 @@
</cfquery> </cfquery>
<!--- пробегаемся по CFS параметрам данной операции---> <!--- пробегаемся по CFS параметрам данной операции--->
<!---*** Нужно проверять только для тех операций, которые предусматривают resourceRealm --->
<cfquery name="local.qCheckResourceRealmAccess"> <cfquery name="local.qCheckResourceRealmAccess">
select r.resource_realm_id, r.resource_realm, sop.svc_operation_cfs_param, iop.param_value, a.contract_id, a.is_enabled select r.resource_realm_id, r.resource_realm, sop.svc_operation_cfs_param, iop.param_value, a.contract_id, a.is_enabled
from instance_operation_cfs_param iop from instance_operation_cfs_param iop
@@ -386,7 +388,7 @@
</cfquery> </cfquery>
<cfif local.qCheckResourceRealmAccess.recordCount EQ 0> <cfif local.qCheckResourceRealmAccess.recordCount EQ 0>
<cfthrow message="resource realm specified in CFS params is not available for current contract" detail="CFS resource realm unawailable. Instance operation UID #arguments.instanceOperationUid#. Contract ID #arguments.contractId#"/> <cfthrow message="resource realm specified in CFS params is not available for current contract" detail="CFS resource realm unawailable. Instance operation UID #arguments.instanceOperationUid#. Contract ID #local.qContract.contract_id#"/>
<cfelse> <cfelse>
<!--- <cfdump var=#local.qCheckResourceRealmAccess#/><cfabort/> ---> <!--- <cfdump var=#local.qCheckResourceRealmAccess#/><cfabort/> --->
<!--- <cfthrow detail="wefwewewewewewer2r24"/> ---> <!--- <cfthrow detail="wefwewewewewewer2r24"/> --->
@@ -398,7 +400,7 @@
<cfargument name="instanceOperationUid" type="guid"> <cfargument name="instanceOperationUid" type="guid">
<cfset var local={}/> <cfset var local={}/>
<!--- Проверяем наличие RFS параметра resourceRealm у операции сервиса --->
<cfquery name="local.qParam"> <cfquery name="local.qParam">
select iop.param select iop.param
from instance_operation io from instance_operation io
@@ -439,7 +441,7 @@
</cfquery> </cfquery>
<cfif local.qCheckResourceRealmAccess.recordCount EQ 0> <cfif local.qCheckResourceRealmAccess.recordCount EQ 0>
<cfthrow message="resource realm specified in RFS params is not available for current contract" detail="RFS resource realm unawailable. Instance operation UID #arguments.instanceOperationUid#. Contract ID #arguments.contractId#"/> <cfthrow message="resource realm specified in RFS params is not available for current contract" detail="RFS resource realm unawailable. Instance operation UID #arguments.instanceOperationUid#. Contract ID #local.qContract.contract_id#"/>
<cfelse> <cfelse>
<!--- <cfdump var=#local.qCheckResourceRealmAccess#/><cfabort/> ---> <!--- <cfdump var=#local.qCheckResourceRealmAccess#/><cfabort/> --->
<!--- <cfthrow detail="wefwewewewewewer2r24"/> ---> <!--- <cfthrow detail="wefwewewewewewer2r24"/> --->