UWVA#73608 autorisatie-checks verbeterd

svn path=/Website/branches/v2022.2/; revision=56646
This commit is contained in:
2022-07-20 21:53:50 +00:00
parent 708d965eaf
commit c0d9cdbed7
3 changed files with 37 additions and 25 deletions

View File

@@ -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

View File

@@ -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";

View File

@@ -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 <20><>n van die
// ruimtes dan geldt uitsluitend de dropruimte