light modification
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package workspace
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"cloud.o-forge.io/core/oc-lib/models/collaborative_area/shallow_collaborative_area"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
@@ -23,15 +21,12 @@ func (d *Workspace) GetAccessor(request *tools.APIRequest) utils.Accessor {
|
||||
}
|
||||
|
||||
func (ao *Workspace) VerifyAuth(request *tools.APIRequest) bool {
|
||||
fmt.Println("Workspace.VerifyAuth", ao.Shared)
|
||||
if ao.Shared != "" {
|
||||
shared, code, _ := shallow_collaborative_area.NewAccessor(request).LoadOne(ao.Shared)
|
||||
fmt.Println("Workspace.VerifyAuth", shared, code)
|
||||
if code != 200 || shared == nil {
|
||||
return false
|
||||
}
|
||||
return shared.VerifyAuth(request)
|
||||
}
|
||||
fmt.Println("Workspace.VerifyAuth", ao.AbstractObject.VerifyAuth(request))
|
||||
return ao.AbstractObject.VerifyAuth(request)
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ func (a *workspaceMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject,
|
||||
}
|
||||
res, _, err := a.Search(filters, "", true) // Search for the workspace
|
||||
if err == nil && len(res) > 0 { // If the workspace already exists, return an error
|
||||
return nil, 409, errors.New("A workspace with the same name already exists")
|
||||
return nil, 409, errors.New("a workspace with the same name already exists")
|
||||
}
|
||||
// reset the resources
|
||||
d := data.(*Workspace)
|
||||
|
Reference in New Issue
Block a user