summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorRémy Boulanouar <rboulanouar@gmail.com>2019-02-18 17:00:27 +0100
committerLauris BH <lauris@nix.lv>2019-02-18 18:00:27 +0200
commit64ce159a6eacc81962d07a8f5ef7f69c17365363 (patch)
treed6b94d035de14df8b1a773d97ab35937cce1d00a /routers/user
parentae3a913122d3430ccf14da22f09daf6f636a00f8 (diff)
downloadgitea-64ce159a6eacc81962d07a8f5ef7f69c17365363.tar.gz
gitea-64ce159a6eacc81962d07a8f5ef7f69c17365363.zip
Allow to set organization visibility (public, internal, private) (#1763)
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/home.go6
-rw-r--r--routers/user/profile.go2
2 files changed, 8 insertions, 0 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index 67a882af9c..c4e169befd 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -386,6 +386,12 @@ func showOrgProfile(ctx *context.Context) {
}
org := ctx.Org.Organization
+
+ if !models.HasOrgVisible(org, ctx.User) {
+ ctx.NotFound("HasOrgVisible", nil)
+ return
+ }
+
ctx.Data["Title"] = org.DisplayName()
var orderBy models.SearchOrderBy
diff --git a/routers/user/profile.go b/routers/user/profile.go
index afb74fe8c3..b1daa9e496 100644
--- a/routers/user/profile.go
+++ b/routers/user/profile.go
@@ -1,4 +1,5 @@
// Copyright 2015 The Gogs Authors. All rights reserved.
+// Copyright 2019 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.
@@ -98,6 +99,7 @@ func Profile(ctx *context.Context) {
}
ctx.Data["Orgs"] = orgs
+ ctx.Data["HasOrgsVisible"] = models.HasOrgsVisible(orgs, ctx.User)
tab := ctx.Query("tab")
ctx.Data["TabName"] = tab