add username to our trip
This commit is contained in:
@@ -18,18 +18,18 @@ type Workspace struct {
|
||||
Shared string `json:"shared,omitempty" bson:"shared,omitempty"` // Shared is the ID of the shared workspace
|
||||
}
|
||||
|
||||
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 (d *Workspace) GetAccessor(username string, peerID string, groups []string, caller *tools.HTTPCaller) utils.Accessor {
|
||||
return New(tools.WORKSPACE, username, peerID, groups, caller) // Create a new instance of the accessor
|
||||
}
|
||||
|
||||
func (ao *Workspace) VerifyAuth(peerID string, groups []string) bool {
|
||||
func (ao *Workspace) VerifyAuth(username string, peerID string, groups []string) bool {
|
||||
fmt.Println("Workspace.VerifyAuth", ao.Shared)
|
||||
if ao.Shared != "" {
|
||||
shared, code, _ := shallow_collaborative_area.New(tools.COLLABORATIVE_AREA, peerID, groups, nil).LoadOne(ao.Shared)
|
||||
shared, code, _ := shallow_collaborative_area.New(tools.COLLABORATIVE_AREA, username, peerID, groups, nil).LoadOne(ao.Shared)
|
||||
if code != 200 || shared == nil {
|
||||
return false
|
||||
}
|
||||
return shared.VerifyAuth(peerID, groups)
|
||||
return shared.VerifyAuth(username, peerID, groups)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user