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. |