| Index: milo/appengine/settings/acl.go
|
| diff --git a/milo/appengine/settings/acl.go b/milo/appengine/settings/acl.go
|
| deleted file mode 100644
|
| index 2f0f84634d31ce0ef8191bccd5e028b89ce8f1e7..0000000000000000000000000000000000000000
|
| --- a/milo/appengine/settings/acl.go
|
| +++ /dev/null
|
| @@ -1,38 +0,0 @@
|
| -// Copyright 2016 The LUCI Authors. All rights reserved.
|
| -// Use of this source code is governed under the Apache License, Version 2.0
|
| -// that can be found in the LICENSE file.
|
| -
|
| -package settings
|
| -
|
| -import (
|
| - "github.com/luci/luci-go/luci_config/common/cfgtypes"
|
| - "github.com/luci/luci-go/luci_config/server/cfgclient/access"
|
| - "github.com/luci/luci-go/luci_config/server/cfgclient/backend"
|
| - "golang.org/x/net/context"
|
| -)
|
| -
|
| -// Helper functions for ACL checking.
|
| -
|
| -// IsAllowed checks to see if the user in the context is allowed to access
|
| -// the given project.
|
| -func IsAllowed(c context.Context, project string) (bool, error) {
|
| - // Get the project, because that's where the ACLs lie.
|
| - err := access.Check(
|
| - c, backend.AsUser,
|
| - cfgtypes.ProjectConfigSet(cfgtypes.ProjectName(project)))
|
| - switch err {
|
| - case nil:
|
| - return true, nil
|
| - case access.ErrNoAccess:
|
| - return false, nil
|
| - default:
|
| - return false, err
|
| - }
|
| -}
|
| -
|
| -// IsAllowedInternal is a shorthand for checking to see if the user is a reader
|
| -// of a magic project named "chrome".
|
| -func IsAllowedInternal(c context.Context) (bool, error) {
|
| - // TODO(hinoka): Move this to luci-cfg.
|
| - return IsAllowed(c, "chrome")
|
| -}
|
|
|