mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-11 15:32:47 +00:00
current user owns 0-author brew only if edit mode
Previous code was treating /share/ visits to google brews with no stub as visits by owner, thus using their own credentials to open the file instead of serviceaccount
This commit is contained in:
@@ -106,7 +106,7 @@ const api = {
|
|||||||
stub = stub?.toObject();
|
stub = stub?.toObject();
|
||||||
googleId ??= stub?.googleId;
|
googleId ??= stub?.googleId;
|
||||||
|
|
||||||
const isOwner = !stub || stub?.authors?.length === 0 || stub?.authors?.[0] === req.account?.username;
|
const isOwner = (accessType == 'edit' && (!stub || stub?.authors?.length === 0)) || stub?.authors?.[0] === req.account?.username;
|
||||||
const isAuthor = stub?.authors?.includes(req.account?.username);
|
const isAuthor = stub?.authors?.includes(req.account?.username);
|
||||||
const isInvited = stub?.invitedAuthors?.includes(req.account?.username);
|
const isInvited = stub?.invitedAuthors?.includes(req.account?.username);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user