1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

hide issues from org private repos w/o team assignment (#4034)

This commit is contained in:
David Schneiderbauer
2018-06-21 18:00:13 +02:00
committed by techknowlogick
parent 46d19c4676
commit 0b3ea42847
24 changed files with 545 additions and 72 deletions

View File

@@ -203,7 +203,11 @@ func Issues(ctx *context.Context) {
return
}
} else {
userRepoIDs, err = ctxUser.GetAccessRepoIDs()
unitType := models.UnitTypeIssues
if isPullList {
unitType = models.UnitTypePullRequests
}
userRepoIDs, err = ctxUser.GetAccessRepoIDs(unitType)
if err != nil {
ctx.ServerError("ctxUser.GetAccessRepoIDs", err)
return

View File

@@ -26,8 +26,8 @@ func TestIssues(t *testing.T) {
Issues(ctx)
assert.EqualValues(t, http.StatusOK, ctx.Resp.Status())
assert.EqualValues(t, map[int64]int64{1: 1, 2: 1}, ctx.Data["Counts"])
assert.EqualValues(t, map[int64]int64{1: 1}, ctx.Data["Counts"])
assert.EqualValues(t, true, ctx.Data["IsShowClosed"])
assert.Len(t, ctx.Data["Issues"], 1)
assert.Len(t, ctx.Data["Repos"], 2)
assert.Len(t, ctx.Data["Repos"], 1)
}