From 1c63f14570aaf9c5e76f2b19cd121a87ea756bd8 Mon Sep 17 00:00:00 2001 From: Marcus de Moura Date: Wed, 4 Dec 2024 22:39:50 +0100 Subject: [PATCH] fix: keep _id when removing unauthorized fields --- src/imports/utils/accessUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imports/utils/accessUtils.ts b/src/imports/utils/accessUtils.ts index 6164868..4f82979 100644 --- a/src/imports/utils/accessUtils.ts +++ b/src/imports/utils/accessUtils.ts @@ -129,7 +129,7 @@ export function removeUnauthorizedDataForRead(metaAccess: MetaAccess, data: Reco if (!isObject(data)) { return data; } - const newData: typeof data = {}; + const newData: typeof data = { _id: data._id }; for (const fieldName in data) { const access = getFieldPermissions(metaAccess, fieldName);