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

Side by Side Diff: appengine/logdog/coordinator/endpoints/logs/list_test.go

Issue 1971493003: LogDog: Project READ access for user endpoints. (Closed) Base URL: https://github.com/luci/luci-go@logdog-project-service-config
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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package logs 5 package logs
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "testing" 9 "testing"
10 10
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 l, err := svc.List(c, &req) 185 l, err := svc.List(c, &req)
186 So(err, ShouldBeRPCOK) 186 So(err, ShouldBeRPCOK)
187 So(listPaths(l), ShouldResemble, all[:1] ) 187 So(listPaths(l), ShouldResemble, all[:1] )
188 188
189 all = all[1:] 189 all = all[1:]
190 req.Next = l.Next 190 req.Next = l.Next
191 } 191 }
192 }) 192 })
193 }) 193 })
194 194
195 » » Convey(`If the project does not exist, will return NotFound.`, f unc() { 195 » » Convey(`If the project does not exist, will return PermissionDen ied.`, func() {
196 req.Project = "does-not-exist" 196 req.Project = "does-not-exist"
197 197
198 _, err := svc.List(c, &req) 198 _, err := svc.List(c, &req)
199 » » » So(err, ShouldBeRPCNotFound) 199 » » » So(err, ShouldBeRPCPermissionDenied)
200 }) 200 })
201 201
202 Convey(`If the user can't access the project, will return Permis sionDenied.`, func() {
203 req.Project = "proj-exclusive"
204
205 _, err := svc.List(c, &req)
206 So(err, ShouldBeRPCPermissionDenied)
207 })
202 }) 208 })
203 } 209 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698