some
This commit is contained in:
@@ -59,9 +59,7 @@ func (ao *CollaborativeArea) VerifyAuth(peerID string, groups []string) bool {
|
||||
}
|
||||
|
||||
func (d *CollaborativeArea) GetAccessor(peerID string, groups []string, caller *tools.HTTPCaller) utils.Accessor {
|
||||
data := New(peerID, groups) // Create a new instance of the accessor
|
||||
data.Init(tools.COLLABORATIVE_AREA, peerID, groups, caller) // Initialize the accessor with the SHARED_WORKSPACE model type
|
||||
return data
|
||||
return New(tools.COLLABORATIVE_AREA, peerID, groups, caller) // Create a new instance of the accessor
|
||||
}
|
||||
|
||||
func (d *CollaborativeArea) Trim() *CollaborativeArea {
|
||||
|
@@ -9,6 +9,7 @@ import (
|
||||
"cloud.o-forge.io/core/oc-lib/config"
|
||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"cloud.o-forge.io/core/oc-lib/logs"
|
||||
"cloud.o-forge.io/core/oc-lib/models/collaborative_area/rules/rule"
|
||||
"cloud.o-forge.io/core/oc-lib/models/peer"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
@@ -27,9 +28,15 @@ type collaborativeAreaMongoAccessor struct {
|
||||
ruleAccessor utils.Accessor
|
||||
}
|
||||
|
||||
// New creates a new instance of the collaborativeAreaMongoAccessor
|
||||
func New(peerID string, groups []string) *collaborativeAreaMongoAccessor {
|
||||
func New(t tools.DataType, peerID string, groups []string, caller *tools.HTTPCaller) *collaborativeAreaMongoAccessor {
|
||||
return &collaborativeAreaMongoAccessor{
|
||||
AbstractAccessor: utils.AbstractAccessor{
|
||||
Logger: logs.CreateLogger(t.String()), // Create a logger with the data type
|
||||
Caller: caller,
|
||||
PeerID: peerID,
|
||||
Groups: groups, // Set the caller
|
||||
Type: t.String(),
|
||||
},
|
||||
workspaceAccessor: (&workspace.Workspace{}).GetAccessor(peerID, groups, nil),
|
||||
workflowAccessor: (&w.Workflow{}).GetAccessor(peerID, groups, nil),
|
||||
peerAccessor: (&peer.Peer{}).GetAccessor(peerID, groups, nil),
|
||||
|
@@ -21,7 +21,5 @@ func (r *Rule) GenerateID() {
|
||||
}
|
||||
|
||||
func (d *Rule) GetAccessor(peerID string, groups []string, caller *tools.HTTPCaller) utils.Accessor {
|
||||
data := New()
|
||||
data.Init(tools.RULE, peerID, groups, caller)
|
||||
return data
|
||||
return New(tools.RULE, peerID, groups, caller)
|
||||
}
|
||||
|
@@ -3,7 +3,9 @@ package rule
|
||||
import (
|
||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"cloud.o-forge.io/core/oc-lib/logs"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
"cloud.o-forge.io/core/oc-lib/tools"
|
||||
)
|
||||
|
||||
type ruleMongoAccessor struct {
|
||||
@@ -11,8 +13,16 @@ type ruleMongoAccessor struct {
|
||||
}
|
||||
|
||||
// New creates a new instance of the ruleMongoAccessor
|
||||
func New() *ruleMongoAccessor {
|
||||
return &ruleMongoAccessor{}
|
||||
func New(t tools.DataType, peerID string, groups []string, caller *tools.HTTPCaller) *ruleMongoAccessor {
|
||||
return &ruleMongoAccessor{
|
||||
AbstractAccessor: utils.AbstractAccessor{
|
||||
Logger: logs.CreateLogger(t.String()), // Create a logger with the data type
|
||||
Caller: caller,
|
||||
PeerID: peerID,
|
||||
Groups: groups, // Set the caller
|
||||
Type: t.String(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// GetType returns the type of the rule
|
||||
|
@@ -19,7 +19,5 @@ type ShallowCollaborativeArea struct {
|
||||
}
|
||||
|
||||
func (d *ShallowCollaborativeArea) GetAccessor(peerID string, groups []string, caller *tools.HTTPCaller) utils.Accessor {
|
||||
data := New()
|
||||
data.Init(tools.COLLABORATIVE_AREA, peerID, groups, caller)
|
||||
return data
|
||||
return New(tools.COLLABORATIVE_AREA, peerID, groups, caller)
|
||||
}
|
||||
|
@@ -3,15 +3,25 @@ package shallow_collaborative_area
|
||||
import (
|
||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"cloud.o-forge.io/core/oc-lib/logs"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
"cloud.o-forge.io/core/oc-lib/tools"
|
||||
)
|
||||
|
||||
type shallowSharedWorkspaceMongoAccessor struct {
|
||||
utils.AbstractAccessor
|
||||
}
|
||||
|
||||
func New() *shallowSharedWorkspaceMongoAccessor {
|
||||
return &shallowSharedWorkspaceMongoAccessor{}
|
||||
func New(t tools.DataType, peerID string, groups []string, caller *tools.HTTPCaller) *shallowSharedWorkspaceMongoAccessor {
|
||||
return &shallowSharedWorkspaceMongoAccessor{
|
||||
AbstractAccessor: utils.AbstractAccessor{
|
||||
Logger: logs.CreateLogger(t.String()), // Create a logger with the data type
|
||||
Caller: caller,
|
||||
PeerID: peerID,
|
||||
Groups: groups, // Set the caller
|
||||
Type: t.String(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (wfa *shallowSharedWorkspaceMongoAccessor) DeleteOne(id string) (utils.DBObject, int, error) {
|
||||
|
Reference in New Issue
Block a user