| Index: appengine/logdog/coordinator/endpoints/services/service.go
|
| diff --git a/appengine/logdog/coordinator/endpoints/services/service.go b/appengine/logdog/coordinator/endpoints/services/service.go
|
| index cf4e37403bf31c2365bd600cead3aba080074f61..1be8d13d2038ce87e423146154aac0f14b93eb4c 100644
|
| --- a/appengine/logdog/coordinator/endpoints/services/service.go
|
| +++ b/appengine/logdog/coordinator/endpoints/services/service.go
|
| @@ -7,7 +7,9 @@ package services
|
| import (
|
| "github.com/golang/protobuf/proto"
|
| "github.com/luci/luci-go/appengine/logdog/coordinator"
|
| + "github.com/luci/luci-go/appengine/logdog/coordinator/endpoints"
|
| "github.com/luci/luci-go/common/api/logdog_coordinator/services/v1"
|
| + "github.com/luci/luci-go/common/config"
|
| "github.com/luci/luci-go/common/grpcutil"
|
| log "github.com/luci/luci-go/common/logging"
|
| "golang.org/x/net/context"
|
| @@ -34,6 +36,16 @@ func New() logdog.ServicesServer {
|
| }
|
| return nil, grpcutil.PermissionDenied
|
| }
|
| +
|
| + // Enter a datastore namespace based on the message type.
|
| + //
|
| + // We use a type switch here because this is a shared decorator.
|
| + if pbm, ok := req.(endpoints.ProjectBoundMessage); ok {
|
| + if err := coordinator.WithProjectNamespace(&c, config.ProjectName(pbm.GetMessageProject())); err != nil {
|
| + return nil, grpcutil.Internal
|
| + }
|
| + }
|
| +
|
| return c, nil
|
| },
|
| }
|
|
|