adding inputs output struct based on argo naming for now
This commit is contained in:
		| @@ -33,7 +33,7 @@ type CollaborativeArea struct { | |||||||
| 	Attributes            map[string]interface{} `json:"attributes,omitempty" bson:"attributes,omitempty"`                       // Attributes is the attributes of the workspace (TODO) | 	Attributes            map[string]interface{} `json:"attributes,omitempty" bson:"attributes,omitempty"`                       // Attributes is the attributes of the workspace (TODO) | ||||||
| 	Workspaces            []string               `json:"workspaces" bson:"workspaces"`                                           // Workspaces is the workspaces of the workspace | 	Workspaces            []string               `json:"workspaces" bson:"workspaces"`                                           // Workspaces is the workspaces of the workspace | ||||||
| 	Workflows             []string               `json:"workflows" bson:"workflows"`                                             // Workflows is the workflows of the workspace | 	Workflows             []string               `json:"workflows" bson:"workflows"`                                             // Workflows is the workflows of the workspace | ||||||
| 	AllowedPeersGroup     map[string][]string    `json:"allowed_peers_group,omitempty" bson:"allowed_peers_group,omitempty"`     // AllowedPeersGroup is the group of allowed peers | 	AllowedPeersGroup     map[string][]string    `json:"allowed_peers_group" bson:"allowed_peers_group"`                         // AllowedPeersGroup is the group of allowed peers | ||||||
| 	Rules                 []string               `json:"rules" bson:"rules,omitempty"`                                           // Rules is the rules of the workspace | 	Rules                 []string               `json:"rules" bson:"rules,omitempty"`                                           // Rules is the rules of the workspace | ||||||
|  |  | ||||||
| 	SharedRules      []*rule.Rule           `json:"shared_rules,omitempty" bson:"-"`      // SharedRules is the shared rules of the workspace | 	SharedRules      []*rule.Rule           `json:"shared_rules,omitempty" bson:"-"`      // SharedRules is the shared rules of the workspace | ||||||
| @@ -83,6 +83,9 @@ func (ao *CollaborativeArea) VerifyAuth(request *tools.APIRequest) bool { | |||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  | 		if ao.CreatorID == request.PeerID { | ||||||
|  | 			return true | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
| 	return ao.AbstractObject.VerifyAuth(request) | 	return ao.AbstractObject.VerifyAuth(request) | ||||||
| } | } | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ type Owner struct { | |||||||
| func GenericStoreOne(data DBObject, a Accessor) (DBObject, int, error) { | func GenericStoreOne(data DBObject, a Accessor) (DBObject, int, error) { | ||||||
| 	data.GenerateID() | 	data.GenerateID() | ||||||
| 	data.StoreDraftDefault() | 	data.StoreDraftDefault() | ||||||
| 	data.UpToDate(a.GetUser(), true) | 	data.UpToDate(a.GetPeerID(), true) | ||||||
| 	f := dbs.Filters{ | 	f := dbs.Filters{ | ||||||
| 		Or: map[string][]dbs.Filter{ | 		Or: map[string][]dbs.Filter{ | ||||||
| 			"abstractresource.abstractobject.name": {{ | 			"abstractresource.abstractobject.name": {{ | ||||||
| @@ -81,7 +81,7 @@ func GenericUpdateOne(set DBObject, id string, a Accessor, new DBObject) (DBObje | |||||||
| 		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 this collaborative area") | ||||||
| 	} | 	} | ||||||
| 	set = newSet | 	set = newSet | ||||||
| 	r.UpToDate(a.GetUser(), false) | 	r.UpToDate(a.GetPeerID(), false) | ||||||
| 	if a.ShouldVerifyAuth() && !r.VerifyAuth(a.GetRequest()) { | 	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 this collaborative area") | ||||||
| 	} | 	} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user