hide repo if hidden

This commit is contained in:
Matti Ranta 2018-06-29 17:59:51 -04:00
parent 0b0b603a4b
commit 6db8162c04
No known key found for this signature in database
GPG Key ID: D9B5613BEB813F99
2 changed files with 7 additions and 0 deletions

View File

@ -276,6 +276,12 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
// Home render repository home page
func Home(ctx *context.Context) {
canSeeOrg := models.HasOrgVisible([]*models.User{ctx.Repo.Repository.Owner}, ctx.User)
if !canSeeOrg {
ctx.NotFound("HasOrgVisible", nil)
return
}
if len(ctx.Repo.Repository.Units) > 0 {
var firstUnit *models.Unit
for _, repoUnit := range ctx.Repo.Repository.Units {

View File

@ -1,4 +1,5 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.