123 resource realm relaxation
This commit is contained in:
@@ -129,10 +129,6 @@
|
||||
<cfset setInstanceOperationRfsParam(arguments.instanceOperationUid, "contragentCode", getContragentCode(arguments.contragentId))/>
|
||||
</cfif>
|
||||
|
||||
<!--- <cfif listFind("create,redeploy",qSvcOperation.operation)>
|
||||
<cfset CreateObject("component", "instance_operation_ls").checkResourceRealmId(qSvcOperation.resource_realm_id, qSvcOperation.instance_uid)/>
|
||||
<cfset setInstanceOperationRfsParam(arguments.instanceOperationUid, "resourceRealm", qSvcOperation.resource_realm)/>
|
||||
</cfif> --->
|
||||
|
||||
<cfquery name="qWriteRfsFromCfsParams">
|
||||
insert into instance_operation_param (instance_operation_uid,param,param_value)
|
||||
@@ -360,7 +356,9 @@
|
||||
|
||||
<cfset var local={}/>
|
||||
|
||||
<!--- Проверяем наличие CFS параметра resourceRealm у операции инстанса (не глядя на то, определен он или нет у операции сервиса) --->
|
||||
<!--- Проверяем наличие CFS параметра resourceRealm у операции инстанса,
|
||||
если он определен у операции сервиса
|
||||
--->
|
||||
<!--- структура cfs и rfs параметров отличается, поэтому селекты разные --->
|
||||
<cfquery name="local.qParam">
|
||||
select sop.svc_operation_cfs_param
|
||||
@@ -392,8 +390,7 @@
|
||||
where io.instance_operation_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceOperationUid#" null=#!isValid("guid",arguments.instanceOperationUid)#/>
|
||||
</cfquery>
|
||||
|
||||
<!--- пробегаемся по CFS параметрам данной операции--->
|
||||
<!---*** Нужно проверять только для тех операций, которые предусматривают resourceRealm --->
|
||||
<!--- проверяем доступ к CFS параметру resourceRealm данной операции --->
|
||||
<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
|
||||
from instance_operation_cfs_param iop
|
||||
@@ -419,17 +416,27 @@
|
||||
|
||||
<cfset var local={}/>
|
||||
<!--- Проверяем наличие RFS параметра resourceRealm у операции сервиса --->
|
||||
<cfquery name="local.qParam">
|
||||
<!--- <cfquery name="local.qParam">
|
||||
select iop.param
|
||||
from instance_operation io
|
||||
join instance_operation_param iop on (io.instance_operation_uid=iop.instance_operation_uid)
|
||||
where io.instance_operation_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceOperationUid#" null=#!isValid("guid",arguments.instanceOperationUid)#/>
|
||||
AND LOWER(iop.param)=LOWER('resourceRealm')
|
||||
</cfquery> <!--- Проверка на LOWER: возможная атака, поэтому трактуем расширенно --->
|
||||
</cfquery> --->
|
||||
<cfquery name="local.qParam">
|
||||
select sop.svc_operation_param
|
||||
from instance_operation io
|
||||
join instance e on (io.instance_uid=e.instance_uid)
|
||||
join svc_operation so on (e.service_id=so.svc_id AND io.operation=so.operation)
|
||||
join svc_operation_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)#/>
|
||||
AND LOWER(sop.svc_operation_param)=LOWER('resourceRealm')
|
||||
</cfquery><!--- Проверка на LOWER: возможная атака, поэтому трактуем расширенно --->
|
||||
|
||||
<cfif local.qParam.recordCount EQ 0>
|
||||
<cfreturn/><!--- нечего проверять --->
|
||||
<cfreturn/><!--- параметр операции сервиса не найден, нечего проверять --->
|
||||
</cfif>
|
||||
<!--- *** Особенность: если параметр resourceRealm определен у операции сервиса, он ведет себя как обязательный - его отсутствие у инстанса вызовет ошибку при проверке --->
|
||||
|
||||
<cfquery name="local.qOperation">
|
||||
select io.operation
|
||||
@@ -447,7 +454,7 @@
|
||||
where io.instance_operation_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceOperationUid#" null=#!isValid("guid",arguments.instanceOperationUid)#/>
|
||||
</cfquery>
|
||||
|
||||
<!--- пробегаемся по RFS параметрам данной операции--->
|
||||
<!--- проверяем доступ к RFS параметру resourceRealm данной операции --->
|
||||
<cfquery name="local.qCheckResourceRealmAccess">
|
||||
select r.resource_realm_id, r.resource_realm, iop.param, iop.param_value, a.contract_id, a.is_enabled
|
||||
from resource_realm r
|
||||
|
||||
Reference in New Issue
Block a user