mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-14 21:32:41 +00:00
Merge pull request #2509 from jeddai/disable-changes-from-non-authors
Disable changes from non authors
This commit is contained in:
@@ -43,6 +43,9 @@ const getBrew = (accessType, stubOnly = false)=>{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
stub = stub?.toObject();
|
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 there is a google id, try to find the google brew
|
||||||
if(!stubOnly && (googleId || stub?.googleId)) {
|
if(!stubOnly && (googleId || stub?.googleId)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user