mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-11 02:32:41 +00:00
add a check for the accessType when editing a document
This commit is contained in:
@@ -43,7 +43,7 @@ const getBrew = (accessType, fetchGoogle = true)=>{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
stub = stub?.toObject();
|
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.';
|
throw 'Current logged in user does not have access to this brew.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user