From 4c629772cc7d09e4f0950f67029529e55638b48b Mon Sep 17 00:00:00 2001 From: Charlie Humphreys Date: Mon, 5 Dec 2022 22:11:24 -0600 Subject: [PATCH] add a check for the accessType when editing a document --- server/homebrew.api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 563926f01..e5d304b69 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -43,7 +43,7 @@ const getBrew = (accessType, fetchGoogle = true)=>{ } }); stub = stub?.toObject(); - if(stub?.authors && !stub?.authors.includes(req.account.username)) { + if(accessType === 'edit' && stub?.authors && !stub?.authors.includes(req.account.username)) { throw 'Current logged in user does not have access to this brew.'; }