diff --git a/server/homebrew.api.js b/server/homebrew.api.js index b36f1d4fa..0a113c8b9 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -43,6 +43,9 @@ const getBrew = (accessType, stubOnly = false)=>{ } }); stub = stub?.toObject(); + if(accessType === 'edit' && stub?.authors?.length > 0 && !stub?.authors.includes(req.account?.username)) { + throw 'Current logged in user does not have access to this brew.'; + } // If there is a google id, try to find the google brew if(!stubOnly && (googleId || stub?.googleId)) {