missing res access

This commit is contained in:
mr 2025-02-17 08:25:19 +01:00
parent 0940b63961
commit cafadec146

View File

@ -100,7 +100,7 @@ func (a *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.
return nil, code, err return nil, code, err
} }
workflow := res.(*Workflow) workflow := res.(*Workflow)
a.execute(workflow, false, false) // update the workspace for the workflow a.execute(workflow, false, true) // update the workspace for the workflow
a.share(workflow, false, a.GetCaller()) // share the update to the peers a.share(workflow, false, a.GetCaller()) // share the update to the peers
return res, code, nil return res, code, nil
} }
@ -119,7 +119,7 @@ func (a *workflowMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, i
workflow := res.(*Workflow) workflow := res.(*Workflow)
a.share(workflow, false, a.GetCaller()) // share the creation to the peers a.share(workflow, false, a.GetCaller()) // share the creation to the peers
a.execute(workflow, false, false) // store the workspace for the workflow a.execute(workflow, false, true) // store the workspace for the workflow
return res, code, nil return res, code, nil
} }
@ -214,10 +214,10 @@ func (a *workflowMongoAccessor) verifyResource(obj utils.DBObject) utils.DBObjec
} else if t == tools.DATA_RESOURCE { } else if t == tools.DATA_RESOURCE {
access = resources.NewAccessor[*resources.DataResource](t, a.GetRequest(), func() utils.DBObject { return &resources.DataResource{} }) access = resources.NewAccessor[*resources.DataResource](t, a.GetRequest(), func() utils.DBObject { return &resources.DataResource{} })
} else { } else {
wf.Graph.Clear(item.Data.GetID()) wf.Graph.Clear(resource.GetID())
} }
if error := utils.VerifyAccess(access, resource.GetID()); wf.Graph != nil && error != nil { if error := utils.VerifyAccess(access, resource.GetID()); error != nil {
wf.Graph.Clear(item.Data.GetID()) wf.Graph.Clear(resource.GetID())
} }
} }
return wf return wf