diff --git a/models/Odmdb.js b/models/Odmdb.js index e658566..519b690 100644 --- a/models/Odmdb.js +++ b/models/Odmdb.js @@ -437,7 +437,7 @@ Odmdb.search = (objectPathname, objsearch, role) => { role.xprofils = role.xprofils.filter((e) => e !== "owner"); } objsearch.fields.forEach((f) => { - if (accessright.R.length == 0 || accessright.R.includes(f)) { + if (accessright.R && accessright.R.length == 0 || accessright.R.includes(f)) { ifields[f] = itm[f]; } else { //ifields[f] = "unauthorized";