From 9712681436a471175e2dc15cea10ef2b310ca976 Mon Sep 17 00:00:00 2001 From: sairajzero Date: Tue, 25 Aug 2020 14:45:12 +0530 Subject: [PATCH] Making public sheets accept their own floID --- index.html | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 96248e6..780d3dc 100644 --- a/index.html +++ b/index.html @@ -10622,15 +10622,16 @@ Bitcoin.Util = { enterLog(title, floID, log){ return new Promise((resolve, reject) => { - if(floGlobals.appObjects.logSheet.sheetList[title].editors && !floGlobals.appObjects.logSheet.sheetList[title].editors.includes(myFloID)) - reject("Only editors can update logs") - else if(!(floID in floGlobals.appObjects.logSheet.personDetails)) - reject("floID not found") - else{ - floCloudAPI.sendGeneralData({floID: floID, log: log}, title) - .then(result => resolve(result)) - .catch(error => reject(error)) - } + if(floGlobals.appObjects.logSheet.sheetList[title].editors){ + if(!floGlobals.appObjects.logSheet.sheetList[title].editors.includes(myFloID)) + return reject("Only editors can update logs"); + else if(!(floID in floGlobals.appObjects.logSheet.personDetails)) + return reject("floID not found"); + } else if(!floGlobals.subAdmins.includes(myFloID) && floID != myFloID) + return reject("Public authorized to log their own floID only"); + floCloudAPI.sendGeneralData({floID: floID, log: log}, title) + .then(result => resolve(result)) + .catch(error => reject(error)) }) },