debug
This commit is contained in:
@@ -3,6 +3,7 @@ package workflow
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"cloud.o-forge.io/core/oc-lib/models/collaborative_area/shallow_collaborative_area"
|
||||
"cloud.o-forge.io/core/oc-lib/models/peer"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
@@ -97,6 +98,20 @@ type Workflow struct {
|
||||
AbstractWorkflow // AbstractWorkflow contains the basic fields of a workflow
|
||||
}
|
||||
|
||||
func (ao *Workflow) VerifyAuth(peerID string, groups []string) bool {
|
||||
isAuthorized := false
|
||||
if len(ao.Shared) > 0 {
|
||||
for _, shared := range ao.Shared {
|
||||
shared, code, _ := shallow_collaborative_area.New(tools.COLLABORATIVE_AREA, peerID, groups, nil).LoadOne(shared)
|
||||
if code != 200 || shared == nil {
|
||||
isAuthorized = false
|
||||
}
|
||||
isAuthorized = shared.VerifyAuth(peerID, groups)
|
||||
}
|
||||
}
|
||||
return isAuthorized
|
||||
}
|
||||
|
||||
/*
|
||||
* CheckBooking is a function that checks the booking of the workflow on peers (even ourselves)
|
||||
*/
|
||||
|
Reference in New Issue
Block a user