aboutsummaryrefslogtreecommitdiffstats
path: root/modules/context
diff options
context:
space:
mode:
Diffstat (limited to 'modules/context')
-rw-r--r--modules/context/repo.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index 8f4377b041..8f2622fa82 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -212,6 +212,17 @@ func RedirectToRepo(ctx *Context, redirectRepoID int64) {
func repoAssignment(ctx *Context, repo *models.Repository) {
var err error
+ if err = repo.GetOwner(); err != nil {
+ ctx.ServerError("GetOwner", err)
+ return
+ }
+
+ if repo.Owner.IsOrganization() {
+ if !models.HasOrgVisible(repo.Owner, ctx.User) {
+ ctx.NotFound("HasOrgVisible", nil)
+ return
+ }
+ }
ctx.Repo.Permission, err = models.GetUserRepoPermission(repo, ctx.User)
if err != nil {
ctx.ServerError("GetUserRepoPermission", err)