0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 07:02:38 +00:00

add a check for the accessType when editing a document

This commit is contained in:
Charlie Humphreys
2022-12-05 22:11:24 -06:00
parent 2e6fcafc68
commit 4c629772cc

View File

@@ -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.';
}