adding inputs output struct based on argo naming for now

This commit is contained in:
mr 2025-02-03 12:38:30 +01:00
parent 2662709fed
commit 275bd56fe6
3 changed files with 6 additions and 12 deletions

View File

@ -83,9 +83,6 @@ func (ao *CollaborativeArea) VerifyAuth(request *tools.APIRequest) bool {
}
}
}
if ao.CreatorID == request.PeerID {
return true
}
}
return ao.AbstractObject.VerifyAuth(request)
}

View File

@ -26,9 +26,6 @@ func (r *WorkflowResource) GetType() string {
func (d *WorkflowResource) Trim() {
/* EMPTY */
}
func (abs *WorkflowResource) VerifyAuth(request *tools.APIRequest) bool {
return true
}
func (w *WorkflowResource) SetAllowedInstances(request *tools.APIRequest) {
/* EMPTY */
}

View File

@ -31,7 +31,7 @@ func GenericStoreOne(data DBObject, a Accessor) (DBObject, int, error) {
},
}
if a.ShouldVerifyAuth() && !data.VerifyAuth(a.GetRequest()) {
return nil, 403, errors.New("you are not allowed to access this collaborative area")
return nil, 403, errors.New("you are not allowed to access : " + a.GetType().String())
}
if cursor, _, _ := a.Search(&f, "", data.IsDrafted()); len(cursor) > 0 {
return nil, 409, errors.New(a.GetType().String() + " with name " + data.GetName() + " already exists")
@ -52,14 +52,14 @@ func GenericStoreOne(data DBObject, a Accessor) (DBObject, int, error) {
func GenericDeleteOne(id string, a Accessor) (DBObject, int, error) {
res, code, err := a.LoadOne(id)
if !res.CanDelete() {
return nil, 403, errors.New("you are not allowed to delete this collaborative area")
return nil, 403, errors.New("you are not allowed to delete :" + a.GetType().String())
}
if err != nil {
a.GetLogger().Error().Msg("Could not retrieve " + id + " to db. Error: " + err.Error())
return nil, code, err
}
if a.ShouldVerifyAuth() && !res.VerifyAuth(a.GetRequest()) {
return nil, 403, errors.New("you are not allowed to access this collaborative area")
return nil, 403, errors.New("you are not allowed to access " + a.GetType().String())
}
_, code, err = mongo.MONGOService.DeleteOne(id, a.GetType().String())
if err != nil {
@ -78,12 +78,12 @@ func GenericUpdateOne(set DBObject, id string, a Accessor, new DBObject) (DBObje
}
ok, newSet := r.CanUpdate(set)
if !ok {
return nil, 403, errors.New("you are not allowed to delete this collaborative area")
return nil, 403, errors.New("you are not allowed to delete :" + a.GetType().String())
}
set = newSet
r.UpToDate(a.GetUser(), a.GetPeerID(), false)
if a.ShouldVerifyAuth() && !r.VerifyAuth(a.GetRequest()) {
return nil, 403, errors.New("you are not allowed to access this collaborative area")
return nil, 403, errors.New("you are not allowed to access :" + a.GetType().String())
}
change := set.Serialize(set) // get the changes
loaded := r.Serialize(r) // get the loaded object
@ -108,7 +108,7 @@ func GenericLoadOne[T DBObject](id string, f func(DBObject) (DBObject, int, erro
}
res_mongo.Decode(&data)
if a.ShouldVerifyAuth() && !data.VerifyAuth(a.GetRequest()) {
return nil, 403, errors.New("you are not allowed to access this collaborative area")
return nil, 403, errors.New("you are not allowed to access :" + a.GetType().String())
}
return f(data)
}