Skip to content

Commit

Permalink
Merge pull request #190 from konecty/fix/keep-id-from-access-removal
Browse files Browse the repository at this point in the history
fix: keep _id when removing unauthorized fields
  • Loading branch information
7sete7 authored Dec 5, 2024
2 parents 84a6755 + 1c63f14 commit d79d679
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 d79d679

Please sign in to comment.