Skip to content

Commit

Permalink
fix: keep _id when removing unauthorized fields
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusdemoura committed Dec 4, 2024
1 parent 84a6755 commit 1c63f14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/imports/utils/accessUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1c63f14

Please sign in to comment.