| Index: appengine/logdog/coordinator/auth.go
|
| diff --git a/appengine/logdog/coordinator/auth.go b/appengine/logdog/coordinator/auth.go
|
| index 6f85e80928ed24d3e9b23430b938e45206d207f3..d9fc6dc622b3a44d579dbd12c29594a9b62bb95e 100644
|
| --- a/appengine/logdog/coordinator/auth.go
|
| +++ b/appengine/logdog/coordinator/auth.go
|
| @@ -45,7 +45,7 @@ func IsServiceUser(c context.Context) error {
|
| // IsProjectReader tests whether the current user belongs to one of the
|
| // project's declared reader groups.
|
| //
|
| -// If the user is not a member of any groups, a MembershipError will be
|
| +// If the user is not a member of any of the groups, a MembershipError will be
|
| // returned.
|
| func IsProjectReader(c context.Context, project luciConfig.ProjectName) error {
|
| pcfg, err := GetServices(c).ProjectConfig(c, project)
|
| @@ -55,6 +55,19 @@ func IsProjectReader(c context.Context, project luciConfig.ProjectName) 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, project luciConfig.ProjectName) error {
|
| + pcfg, err := GetServices(c).ProjectConfig(c, project)
|
| + if err != nil {
|
| + return err
|
| + }
|
| + return checkMember(c, pcfg.WriterAuthGroups...)
|
| +}
|
| +
|
| func checkMember(c context.Context, groups ...string) error {
|
| // On dev-appserver, the superuser has implicit group membership to
|
| // everything.
|
|
|