FSN#35817 Autorisaties via API2/Scaffolding

svn path=/Website/trunk/; revision=28923
This commit is contained in:
Jos Groot Lipman
2016-04-13 14:57:40 +00:00
parent 15c7bfe6c8
commit 24be0cdd81
5 changed files with 42 additions and 33 deletions

View File

@@ -6,6 +6,8 @@
File: fac_functie.asp
Description: Ingang via functies om autorisaties te beheren
Ook: als je ?editmode=1 meegeeft kun je de omschrijving
bewerken van userfuncties
Context: Vanuit het menu
@@ -18,10 +20,18 @@
<!-- #include file="../api2/model_fac_functie.inc" -->
<%
var editmode = getQParamInt("editmode", 0);
var groep_key = getQParamInt("fac_groep", -1);
var disc_key = getQParamInt("ins_discipline", -1);
var model = new model_fac_functie(null, { groep_key: groep_key, disc_key: disc_key });
if (editmode == 1)
{
model.gparams.GET.wheres =["fac_functie_code LIKE 'WEB_USER%'"];
model.REST_PUT = generic_REST_PUT(model);
}
settings.overrule_setting("qp_maxrows", 250); // Toon alle 186 (DB28) functies direct
function fnrowData(oRs)
@@ -34,7 +44,6 @@
{
"search": {
"autosearch": !!model.module,
"labels" : [],
"filters": [
"module",
"description"
@@ -53,18 +62,31 @@
"name",
"description"
],
"default_action": "edit_rechten",
"fnRowData": fnrowData,
"requires": {
js: ["./fac_functie.js"]
},
"script": "window.groep_key = " + groep_key + "; window.disc_key = " + disc_key
},
"edit":{
"modal": true
},
"transit": {
"fac_groep": groep_key,
"ins_discipline" : disc_key
"ins_discipline" : disc_key,
"editmode" : editmode
}
};
if (editmode == 1)
{
scf_params.search.filters.shift(); // "module" filter er uit
scf_params.search.autosearch = true;
}
else
{
scf_params.list.default_action = "edit_rechten";
}
if (groep_key > 0)
{
var groep_desc = Oracle.Get("fac_groep_omschrijving", "fac_groep", groep_key);
@@ -82,6 +104,7 @@
if (disc_key > 0)
{
scf_params.search.labels.push({ "lbl": L("ins_discipline_key"), "txt" : Oracle.Get("ins_discipline_omschrijving", "ins_tab_discipline", "ins_discipline_key", disc_key)});
scf_params.list.columns.pop(); // Discipline kolom mag er nu wel tussenuit
scf_params.list.columns.push(
"authorization.fac_groep",
"authorization.prs_level_read",

View File

@@ -23,5 +23,4 @@ function edit_rechten(row)
var url = "appl/mgt/fac_groep.asp?fac_functie=" + functie_key + "&ins_discipline=" + window.disc_key;
FcltMgr.openDetail(url, { reuse: true });
}
}

View File

@@ -6,7 +6,7 @@
File: fac_groep.asp
Description: Ingang via groepen om autorisaties te beheren
Ook: als je ?editmode=1 meegeeft kun je de groepen toevoegen enz.
Context: Vanuit het menu
Notes:
@@ -18,6 +18,8 @@
<!-- #include file="../api2/model_fac_groep.inc" -->
<%
var editmode = getQParamInt("editmode", 0);
var functie_key = getQParamInt("fac_functie", -1);
var disc_key = getQParamInt("ins_discipline", -1);
@@ -33,7 +35,6 @@
{
"search": {
"autosearch": true,
"labels" : [],
"filters": [
"name",
"remark"
@@ -50,26 +51,30 @@
js: ["./fac_groep.js"]
},
"script": "window.functie_key = " + functie_key + "; window.disc_key = " + disc_key,
"fnRowData": fnrowData,
"default_action": "edit_rechten",
// Via een knop de originele mode=wrap ondersteunen
"actions": [
{ action: "edit_groep", caption: L("fac_groep_edit") }
]
"fnRowData": fnrowData
},
"edit":{
"modal": true
},
"transit": {
"fac_functie": functie_key,
"ins_discipline" : disc_key
"ins_discipline" : disc_key,
"editmode" : editmode
}
};
if (functie_key < 0 && disc_key < 0)
if (editmode == 1)
{
scf_params.search.autosearch = true;
scf_params.list.columns.push("substitutes");
}
else
{
model.REST_POST = false;
model.REST_PUT = false;
model.REST_DELETE = false;
scf_params.list.default_action = "edit_rechten";
}
if (functie_key > 0 && disc_key < 0 && model.includes.authorization.model.hasdisc)
{
scf_params.list.columns.push("authorization.ins_discipline");

View File

@@ -24,10 +24,3 @@ function edit_rechten(row)
FcltMgr.openDetail(url, { reuse: true });
}
}
function edit_groep(row)
{
var groep_key = row.getAttribute("ROWKEY");
var url = "appl/mgt/fac_groep.asp?mode=wrap&id=" + groep_key;
FcltMgr.openDetail(url, { reuse: true });
}

View File

@@ -1,11 +0,0 @@
/*
$Revision$
$Id$
*/
function edit_rechten(row)
{
var perslid_key = row.getAttribute("ROWKEY");
var url = "appl/mgt/prs_perslid.asp?mode=list&model=authorization&scf_title=user&user=" + perslid_key;
FcltMgr.openDetail(url, { reuse: true });
}