diff options
Diffstat (limited to 'routers/web/org/org.go')
-rw-r--r-- | routers/web/org/org.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/web/org/org.go b/routers/web/org/org.go index c66a0cd4c8..b641f768b2 100644 --- a/routers/web/org/org.go +++ b/routers/web/org/org.go @@ -29,7 +29,7 @@ const ( func Create(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("new_org") ctx.Data["DefaultOrgVisibilityMode"] = setting.Service.DefaultOrgVisibilityMode - if !ctx.User.CanCreateOrganization() { + if !ctx.Doer.CanCreateOrganization() { ctx.ServerError("Not allowed", errors.New(ctx.Tr("org.form.create_org_not_allowed"))) return } @@ -41,7 +41,7 @@ func CreatePost(ctx *context.Context) { form := *web.GetForm(ctx).(*forms.CreateOrgForm) ctx.Data["Title"] = ctx.Tr("new_org") - if !ctx.User.CanCreateOrganization() { + if !ctx.Doer.CanCreateOrganization() { ctx.ServerError("Not allowed", errors.New(ctx.Tr("org.form.create_org_not_allowed"))) return } @@ -59,7 +59,7 @@ func CreatePost(ctx *context.Context) { RepoAdminChangeTeamAccess: form.RepoAdminChangeTeamAccess, } - if err := models.CreateOrganization(org, ctx.User); err != nil { + if err := models.CreateOrganization(org, ctx.Doer); err != nil { ctx.Data["Err_OrgName"] = true switch { case user_model.IsErrUserAlreadyExist(err): |