aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo
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/api/v1/repo
parentae3a913122d3430ccf14da22f09daf6f636a00f8 (diff)
downloadgitea-64ce159a6eacc81962d07a8f5ef7f69c17365363.tar.gz
gitea-64ce159a6eacc81962d07a8f5ef7f69c17365363.zip
Allow to set organization visibility (public, internal, private) (#1763)
Diffstat (limited to 'routers/api/v1/repo')
-rw-r--r--routers/api/v1/repo/repo.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index d78700c6b0..f69cbee0c0 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -302,6 +302,11 @@ func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) {
return
}
+ if !models.HasOrgVisible(org, ctx.User) {
+ ctx.NotFound("HasOrgVisible", nil)
+ return
+ }
+
if !ctx.User.IsAdmin {
isOwner, err := org.IsOwnedBy(ctx.User.ID)
if err != nil {