File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import (
22
22
"code.gitea.io/gitea/modules/log"
23
23
"code.gitea.io/gitea/modules/repository"
24
24
"code.gitea.io/gitea/modules/setting"
25
+ "code.gitea.io/gitea/modules/structs"
25
26
"code.gitea.io/gitea/modules/timeutil"
26
27
"code.gitea.io/gitea/modules/validation"
27
28
"code.gitea.io/gitea/routers/utils"
@@ -379,6 +380,14 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
379
380
return
380
381
}
381
382
383
+ if newOwner .Type == models .UserTypeOrganization {
384
+ if ! ctx .User .IsAdmin && newOwner .Visibility == structs .VisibleTypePrivate && ! ctx .User .IsUserPartOfOrg (newOwner .ID ) {
385
+ // The user shouldn't know about this organization
386
+ ctx .RenderWithErr (ctx .Tr ("form.enterred_invalid_owner_name" ), tplSettingsOptions , nil )
387
+ return
388
+ }
389
+ }
390
+
382
391
// Close the GitRepo if open
383
392
if ctx .Repo .GitRepo != nil {
384
393
ctx .Repo .GitRepo .Close ()
You can’t perform that action at this time.
0 commit comments