hide repo if hidden
This commit is contained in:
parent
0b0b603a4b
commit
6db8162c04
|
|
@ -276,6 +276,12 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
|
||||||
|
|
||||||
// Home render repository home page
|
// Home render repository home page
|
||||||
func Home(ctx *context.Context) {
|
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 {
|
if len(ctx.Repo.Repository.Units) > 0 {
|
||||||
var firstUnit *models.Unit
|
var firstUnit *models.Unit
|
||||||
for _, repoUnit := range ctx.Repo.Repository.Units {
|
for _, repoUnit := range ctx.Repo.Repository.Units {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
// Copyright 2014 The Gogs Authors. All rights reserved.
|
// 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
|
// Use of this source code is governed by a MIT-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user