This commit is contained in:
mr
2024-12-03 10:57:28 +01:00
parent 471e0c9d9b
commit ea55c94c73
3 changed files with 27 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
package workspace
import (
"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"
"cloud.o-forge.io/core/oc-lib/tools"
@@ -18,3 +19,14 @@ type Workspace struct {
func (d *Workspace) GetAccessor(peerID string, groups []string, caller *tools.HTTPCaller) utils.Accessor {
return New(tools.WORKSPACE, peerID, groups, caller) // Create a new instance of the accessor
}
func (ao *Workspace) VerifyAuth(peerID string, groups []string) bool {
if ao.Shared != "" {
shared, code, _ := shallow_collaborative_area.New(tools.COLLABORATIVE_AREA, peerID, groups, nil).LoadOne(ao.Shared)
if code != 200 || shared == nil {
return false
}
return shared.VerifyAuth(peerID, groups)
}
return false
}