1
0
forked from apxtri/apxtri

add test accessright.R exist before testing readibility from search

This commit is contained in:
philc 2024-08-14 12:15:12 +02:00
parent 53fad87b25
commit 4fb624162e

View File

@ -437,7 +437,7 @@ Odmdb.search = (objectPathname, objsearch, role) => {
role.xprofils = role.xprofils.filter((e) => e !== "owner"); role.xprofils = role.xprofils.filter((e) => e !== "owner");
} }
objsearch.fields.forEach((f) => { 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]; ifields[f] = itm[f];
} else { } else {
//ifields[f] = "unauthorized"; //ifields[f] = "unauthorized";