AKZA#36947 probeer auto-melding indien geen leesrechten op het object

svn path=/Website/trunk/; revision=30117
This commit is contained in:
Peter Feij
2016-07-25 11:40:27 +00:00
parent df5cf9db66
commit 5cde058d99

View File

@@ -5,8 +5,12 @@
File: ins_deel.asp File: ins_deel.asp
Description: Details of an object (Mobile version) and access to actions on that object Description: Details of an object (Mobile version) and access to actions on that object
If not authorised for this object we automatically forward to a "melding" on this object. If not authorised for this object we can forward to a "melding" on this object if stdmkina
Parameters: ins_key (bv via QRC) Parameters: ins_key (bv via QRC)
stdmkina stdmeldingkey IF NOT AUTHORIZED,
-1/not defined = do not initiate a call if unauthorized
0 = initiate a unspecific (determined by configuration) call if unauthorized and authorized for MLDUSE
>0 = idem for that stdmeldingkey (rare)
*/ %> */ %>
@@ -23,21 +27,40 @@
<% <%
var ins_key = getQParamInt("ins_key"); var ins_key = getQParamInt("ins_key");
var qrc = getQParamInt("qrc", 0) != 0; var qrc = getQParamInt("qrc", 0) != 0;
var stdmkina = getQParamInt("stdmkina", -1); //STDMeldingKeyIfNotAuthorized
//AUTH: mag ik deze zien? var this_ins = ins.func_enabled_deel(ins_key);
var this_ins = ins.func_enabled_deel(ins_key, {"isOptional": true});
// als ik deze details niet mag zien, spring ik door naar het doen van een melding if (stdmkina == -1)
if (!this_ins) { // ik mag helemaal niets {
if (user.checkAutorisation( "WEB_MLDUSE", true)) { // geen alternatief aangegeven, dus wegwezen zonder rechten
var theURL = "./melding.asp?mld_key=-1&ins_key=" + ins_key; user.auth_required_or_abort(this_ins.canReadAny);
Response.Redirect(theURL); }
else
{
// Als ik leesrechten heb dan gaan we (ook) gewoon door
// en laten we de objectdetails zien (met onderin de mogelijkheid voor melding)
// Als ik deze details niet mag zien, spring ik door naar het doen van een melding
if (this_ins.canReadAny)
{
// I am authorized, just go on (disregard stdmkina)
user.auth_required_or_abort(this_ins.canReadAny);
} }
else { else
ins.func_enabled_deel(ins_key, {"isOptional": false}); // effectief hier de not authorized { // ik mag niets zien, doorstarten
if (user.checkAutorisation( "WEB_MLDUSE", true)) {
// Dan laat maar een melding doen
var theURL = "./melding.asp?mld_key=-1&ins_key=" + ins_key + (stdmkina > 0 ? "&stdm_key="+stdmkina : "");
Response.Redirect(theURL);
}
else {
// ik wil wel een melding starten maar ik heb daar helemaal geen rechten voor,
// dan alsnog evt. unauthorized
user.auth_required_or_abort(false);
}
} }
// Could be enhanced to autojump to inspection or reservation under certain conditions }
};
var isResDeel = false; var isResDeel = false;
var perslid_key_beh = -1; var perslid_key_beh = -1;