From 64ce159a6eacc81962d07a8f5ef7f69c17365363 Mon Sep 17 00:00:00 2001 From: Rémy Boulanouar Date: Mon, 18 Feb 2019 17:00:27 +0100 Subject: Allow to set organization visibility (public, internal, private) (#1763) --- routers/user/home.go | 6 ++++++ routers/user/profile.go | 2 ++ 2 files changed, 8 insertions(+) (limited to 'routers/user') 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 -- cgit v1.2.3