From 5dd57f6052a053f352a9efea5eee1ef9c87859a1 Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Sun, 17 Dec 2023 03:17:15 +0530 Subject: [PATCH] logs: trying to debug file API bugs --- files.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files.go b/files.go index 8427940..8aa1f88 100755 --- a/files.go +++ b/files.go @@ -1316,6 +1316,8 @@ func HandleCreateFile(resp http.ResponseWriter, request *http.Request) { } if workflow.ExecutingOrg.Id != curfile.OrgId { + log.Printf("[DEBUG] Workflow executing org (%s) isn't file Org Id (%s) in file create. %d orgs have access to it.", workflow.ExecutingOrg.Id, curfile.OrgId, len(workflow.Org)) + found := false for _, curorg := range workflow.Org { if curorg.Id == curfile.OrgId { @@ -1325,7 +1327,7 @@ func HandleCreateFile(resp http.ResponseWriter, request *http.Request) { } if !found { - log.Printf("[ERROR] Org %s doesn't have access to %s.", curfile.OrgId, curfile.WorkflowId) + log.Printf("[ERROR] Org %s doesn't have access to %s. %s org should instead.", curfile.OrgId, curfile.WorkflowId, curfile.OrgId) resp.WriteHeader(401) resp.Write([]byte(`{"success": false, "reason": "Error with workflow id or org id"}`)) return