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

Unified Diff: appengine/logdog/coordinator/auth.go

Issue 1970823005: LogDog: Add prefix registration endpoint. (Closed) Base URL: https://github.com/luci/luci-go@logdog-project-archivist-useconfig
Patch Set: Updated patchset dependency Created 4 years, 7 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 | « appengine/cmd/logdog_coordinator/vmuser/main.go ('k') | appengine/logdog/coordinator/context.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/logdog/coordinator/auth.go
diff --git a/appengine/logdog/coordinator/auth.go b/appengine/logdog/coordinator/auth.go
index 6626b12a8684881bc9157f8872cab20941b271f8..9537f28ad73159c87defd0964f538559e50fbf3e 100644
--- a/appengine/logdog/coordinator/auth.go
+++ b/appengine/logdog/coordinator/auth.go
@@ -48,6 +48,15 @@ func IsProjectReader(c context.Context, pcfg *svcconfig.ProjectConfig) error {
return checkMember(c, pcfg.ReaderAuthGroups...)
}
+// IsProjectWriter tests whether the current user belongs to one of the
+// project's declared writer groups.
+//
+// If the user is not a member of any of the groups, a MembershipError will be
+// returned.
+func IsProjectWriter(c context.Context, pcfg *svcconfig.ProjectConfig) error {
+ return checkMember(c, pcfg.WriterAuthGroups...)
+}
+
func checkMember(c context.Context, groups ...string) error {
// On dev-appserver, the superuser has implicit group membership to
// everything.
« no previous file with comments | « appengine/cmd/logdog_coordinator/vmuser/main.go ('k') | appengine/logdog/coordinator/context.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698