summaryrefslogtreecommitdiffstats
path: root/routers/user/home.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user/home.go')
-rw-r--r--routers/user/home.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index 49c6579556..4c6a9f6cd0 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -286,7 +286,12 @@ func Issues(ctx *context.Context) {
repo := showReposMap[repoID]
// Check if user has access to given repository.
- if !repo.IsOwnedBy(ctxUser.ID) && !repo.HasAccess(ctxUser) {
+ perm, err := models.GetUserRepoPermission(repo, ctxUser)
+ if err != nil {
+ ctx.ServerError("GetUserRepoPermission", fmt.Errorf("[%d]%v", repoID, err))
+ return
+ }
+ if !perm.CanRead(models.UnitTypeIssues) {
ctx.Status(404)
return
}