From c0d9cdbed7200f2a5e111f12a3867db3d3a2afc8 Mon Sep 17 00:00:00 2001 From: Koen Reefman Date: Wed, 20 Jul 2022 21:53:50 +0000 Subject: [PATCH] UWVA#73608 autorisatie-checks verbeterd svn path=/Website/branches/v2022.2/; revision=56646 --- APPL/CAD/ins_change.asp | 10 +++----- APPL/CAD/ins_create.asp | 49 +++++++++++++++++++++++-------------- APPL/CAD/legenda_create.asp | 3 ++- 3 files changed, 37 insertions(+), 25 deletions(-) diff --git a/APPL/CAD/ins_change.asp b/APPL/CAD/ins_change.asp index 3ea72be11c..44fb5ae41a 100644 --- a/APPL/CAD/ins_change.asp +++ b/APPL/CAD/ins_change.asp @@ -43,21 +43,19 @@ var deel_key = getQParamInt("deel_key"); var scenario_key = getQParamInt("scenario_key"); // current scenario. var wpdeel = getQParamInt("wpdeel", 0); +var autfunction_arr = []; if (scenario_key == 0) { var this_ins = ins.func_enabled_deel(deel_key); - var autfunction_arr = []; for (var func_code in this_ins._funcodes) { autfunction_arr.push(func_code); } - var authparams = user.checkAutorisation(autfunction_arr); } else -{ - var autfunction = "WEB_PRJBOF"; - var authparams = user.checkAutorisation(autfunction); -} + autfunction_arr.push("WEB_PRJBOF"); + +var authparams = user.checkAutorisation(autfunction_arr); if (wpdeel) // Het symbool is getekend relatief aan de werkplek. Voor veel { // situaties hebben we die info nodig dus haal die maar vast op diff --git a/APPL/CAD/ins_create.asp b/APPL/CAD/ins_create.asp index a7456ef628..6d14d737c9 100644 --- a/APPL/CAD/ins_create.asp +++ b/APPL/CAD/ins_create.asp @@ -28,6 +28,7 @@ var inoutMode = getQParamInt("mode"); var scenario_key = getQParamInt("scenario_key"); // current scenario. var srtdeel_key = -1; +var autfunction_arr = []; var deelkey_str = getQParam("deel_key", ""); // (string, kan I:xxx, P:xxx of IW:xxx bevatten) if (deelkey_str != "") // Kopie { @@ -47,40 +48,52 @@ if (deelkey_str != "") // Kopie + " FROM prj_deel" + " WHERE prj_deel_key = " + deel_key; } - var oRs=Oracle.Execute(sql); + var oRs = Oracle.Execute(sql); if (!oRs.Eof) { srtdeel_key = oRs("key").value; rot = oRs("rot").value; scl = oRs("scl").value; + + // Zoek autorisatie functies op, op basis van (ins|prj)_deel_key + if (scenario_key == 0) + { + var this_ins = ins.func_enabled_deel(deel_key); + for (var func_code in this_ins._funcodes) + { + autfunction_arr.push(func_code); + } + } + else + autfunction_arr.push("WEB_PRJBOF"); } oRs.Close(); } + if (srtdeel_key == -1) { var srtdeel_key = getQParamInt("srtdeel_key"); rot = 0; scl = 1.0; + + // Zoek autorisatie functies op, op basis van ins_srtdeel_key + var sql = "SELECT sg.ins_discipline_key" + + " FROM ins_srtdeel sd" + + " , ins_srtgroep sg" + + " WHERE sd.ins_srtgroep_key = sg.ins_srtgroep_key" + + " AND sd.ins_srtdeel_key = " + srtdeel_key; + var oRs = Oracle.Execute(sql); + var disc_key = oRs("ins_discipline_key").Value; + oRs.Close(); + var this_ins = ins.func_enabled_scope(disc_key); + for (var func_code in this_ins._funcodes) + { + autfunction_arr.push(func_code); + } } -// Autorisatie check op ins_srtdeel. -var sql = "SELECT sg.ins_discipline_key" - + " FROM ins_srtdeel sd" - + " , ins_srtgroep sg" - + " WHERE sd.ins_srtgroep_key = sg.ins_srtgroep_key" - + " AND sd.ins_srtdeel_key = " + srtdeel_key; -var oRs = Oracle.Execute(sql); -var disc_key = oRs("ins_discipline_key").Value; -oRs.Close(); -var this_ins = ins.func_enabled_scope(disc_key); -var autfunction_arr = []; -for (var func_code in this_ins._funcodes) -{ - autfunction_arr.push(func_code); -} var authparams = user.checkAutorisation(autfunction_arr); - if (Request.QueryString("dwgX").Count == 0) { var newX = "NULL"; // Droppen met ctrlKey ingedrukt liet XY achterwege @@ -92,7 +105,7 @@ else var newY = parseFloat(getQParamFloat("dwgY")); } -var ins_type=(inoutMode == MODE_IN? 'R' : 'T'); +var ins_type = (inoutMode == MODE_IN? 'R' : 'T'); var roomKey = getQParamInt("room_key", -1); var wpKey = "NULL"; diff --git a/APPL/CAD/legenda_create.asp b/APPL/CAD/legenda_create.asp index dd4114ed27..61c8af02a4 100644 --- a/APPL/CAD/legenda_create.asp +++ b/APPL/CAD/legenda_create.asp @@ -37,7 +37,8 @@ var oRs = Oracle.Execute(sql); var viewname = oRs("cad_thema_view").value; var functie_key = oRs("fac_functie_key").Value; oRs.Close(); -var authparams = user.checkAutorisation(functie_key); +if (functie_key > -1) // Zonder autorisatie functie is dit niet beperkt + user.checkAutorisation(functie_key); // Als meerdere ruimtes gehighlight maar je dropt niet in één van die // ruimtes dan geldt uitsluitend de dropruimte