Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1485)

Unified Diff: milo/appengine/common/acl.go

Issue 2949783002: [milo] appengine/* -> * (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « milo/api/resp/console.go ('k') | milo/appengine/common/acl_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/common/acl.go
diff --git a/milo/appengine/common/acl.go b/milo/appengine/common/acl.go
deleted file mode 100644
index ecb709f1b0c806c4fd2af5465323c5c54d3b7058..0000000000000000000000000000000000000000
--- a/milo/appengine/common/acl.go
+++ /dev/null
@@ -1,43 +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 common
-
-import (
- "golang.org/x/net/context"
-
- "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"
- "github.com/luci/luci-go/server/auth"
-)
-
-// 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) {
- settings := GetSettings(c)
- if settings.Buildbot.InternalReader == "" {
- return false, nil
- }
- return auth.IsMember(c, settings.Buildbot.InternalReader)
-}
« no previous file with comments | « milo/api/resp/console.go ('k') | milo/appengine/common/acl_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698