mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-15 10:32:45 +00:00
prevent changes to brews from non-authors
This commit is contained in:
@@ -43,6 +43,9 @@ const getBrew = (accessType, fetchGoogle = true)=>{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
stub = stub?.toObject();
|
stub = stub?.toObject();
|
||||||
|
if(stub?.authors && !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 there is a google id, try to find the google brew
|
||||||
if(fetchGoogle && (googleId || stub?.googleId)) {
|
if(fetchGoogle && (googleId || stub?.googleId)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user