<% /* $Revision$ $Id$ File: model_fac_functie.inc Description: Dit is het model om de *rechten* van een groep voor diverse functies te beheren. model_fac_functie moet dan ook altijd aangroepen worden met een fac_groep_key Context: Notes: */ %> <% function model_fac_functie (functie_key, params) { this.records_name = "authorizationfunctions"; this.record_name = "authorizationfunction"; this.table = "fac_functie"; this.primary = "fac_functie_key"; this.autfunction = "WEB_PRSMSU"; this.record_title = L("fac_functie"); this.records_title = L("fac_functie_m"); this.module = null; if (params.disc_key > 0) { var sql = "SELECT ins_discipline_module FROM ins_tab_discipline WHERE ins_discipline_key = " + params.disc_key; var oRs = Oracle.Execute(sql); this.module = oRs("ins_discipline_module").Value; oRs.Close(); } this.fields = { "id": { "dbs": "fac_functie_key", "label": L("lcl_key"), "typ": "key", "required": true, "seq": "fac_s_fac_functie_key" }, "module": { "dbs": "fac_functie_module", "label": L("fac_functie_module"), "readonly": true, "typ": "varchar", "filterdefault": this.module?":!"+this.module:null, "showfixedfilter": true, "foreign": { "tbl": "fac_module", "key": "fac_module_name", "desc": "fac_module_name || ' - ' || lcl.l(fac_module_remark)" } }, "name": { "dbs": "fac_functie_code", "label": L("fac_functie_code"), "readonly": true, "typ": "varchar" }, "sequence": { "dbs": "fac_functie_volgnr", "label": L("fac_functie_volgnr"), "readonly": !user.has("WEB_FACFAC"), "typ": "number" }, "level": { "dbs": "fac_functie_min_level", "label": L("fac_functie_min_level"), "readonly": true, "typ": "number", "LOV": L("fac_functie_min_levelLOV"), "hidden_fld": true }, "discipline": { "dbs": "fac_functie_discipline", "label": L("fac_functie_discipline"), "readonly": true, "typ": "number", "LOV": L("fac_functie_disciplineLOV"), "hidden_fld": true }, "group": { "dbs": "fac_functie_groep", "label": L("fac_functie_groep"), "readonly": true, "typ": "number", "LOV": L("fac_functie_groepLOV"), "hidden_fld": true }, "description": { "dbs": "fac_functie_omschrijving", "label": L("fac_functie_omschrijving"), "typ": "varchar", "required": true, "islcl": true }, "info": { "dbs": "fac_functie_info", "label": L("fac_functie_info"), "typ": "memo", "islcl": true } }; if (params.groep_key > 0 || params.disc_key > 0) { this.includes = {"authorization": { "model": new model_fac_groeprechten(params), "joinfield": "authorization", "outertoggle": { def: false, lbl: L("fac_gebruiker_outerfunctie") } }}; } var xparams = { GET: { wheres: [] } } if (params.disc_key > 0) { xparams.GET.wheres.push("fac_functie_module = " + safe.quoted_sql(this.module), "fac_functie_discipline = 1" // dan ook alleen de discipline gebonden functies ); } if (!user.has("WEB_FACFAC")) { xparams.GET.wheres.push("fac_functie_code NOT IN ('WEB_FACFAC', 'WEB_FACTAB')"); } this.REST_GET = generic_REST_GET(this, xparams); //this.REST_POST = generic_REST_POST(this); //this.REST_PUT = generic_REST_PUT(this); //this.REST_DELETE = generic_REST_DELETE(this); } %>