diff options
author | Rémy Boulanouar <rboulanouar@gmail.com> | 2019-02-18 17:00:27 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-02-18 18:00:27 +0200 |
commit | 64ce159a6eacc81962d07a8f5ef7f69c17365363 (patch) | |
tree | d6b94d035de14df8b1a773d97ab35937cce1d00a /routers/org/org.go | |
parent | ae3a913122d3430ccf14da22f09daf6f636a00f8 (diff) | |
download | gitea-64ce159a6eacc81962d07a8f5ef7f69c17365363.tar.gz gitea-64ce159a6eacc81962d07a8f5ef7f69c17365363.zip |
Allow to set organization visibility (public, internal, private) (#1763)
Diffstat (limited to 'routers/org/org.go')
-rw-r--r-- | routers/org/org.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/routers/org/org.go b/routers/org/org.go index bb7540277c..3821b32216 100644 --- a/routers/org/org.go +++ b/routers/org/org.go @@ -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. @@ -23,6 +24,7 @@ const ( // Create render the page for create organization func Create(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("new_org") + ctx.Data["DefaultOrgVisibilityMode"] = setting.Service.DefaultOrgVisibilityMode if !ctx.User.CanCreateOrganization() { ctx.ServerError("Not allowed", errors.New(ctx.Tr("org.form.create_org_not_allowed"))) return @@ -45,9 +47,10 @@ func CreatePost(ctx *context.Context, form auth.CreateOrgForm) { } org := &models.User{ - Name: form.OrgName, - IsActive: true, - Type: models.UserTypeOrganization, + Name: form.OrgName, + IsActive: true, + Type: models.UserTypeOrganization, + Visibility: form.Visibility, } if err := models.CreateOrganization(org, ctx.User); err != nil { |