aboutsummaryrefslogtreecommitdiff
path: root/internal/route/repo
diff options
context:
space:
mode:
authoralpencrossi <62932811+alpencrossi@users.noreply.github.com>2020-04-08 22:13:50 +0200
committerGitHub <noreply@github.com>2020-04-09 04:13:50 +0800
commit3e055e329cf93eb5de77562d7795240808d31c08 (patch)
tree5070d75abb87767b460cd2ee84a951db2b1db868 /internal/route/repo
parent5b36ba66c250ca72d42f034580f0260b090d6e17 (diff)
repo: disable public access option when using external wiki and issue tracker (#6081)
Diffstat (limited to 'internal/route/repo')
-rw-r--r--internal/route/repo/setting.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/route/repo/setting.go b/internal/route/repo/setting.go
index fd281dcc..b96ddf52 100644
--- a/internal/route/repo/setting.go
+++ b/internal/route/repo/setting.go
@@ -156,6 +156,13 @@ func SettingsPost(c *context.Context, f form.RepoSetting) {
repo.PullsIgnoreWhitespace = f.PullsIgnoreWhitespace
repo.PullsAllowRebase = f.PullsAllowRebase
+ if !repo.EnableWiki || repo.EnableExternalWiki {
+ repo.AllowPublicWiki = false
+ }
+ if !repo.EnableIssues || repo.EnableExternalTracker {
+ repo.AllowPublicIssues = false
+ }
+
if err := db.UpdateRepository(repo, false); err != nil {
c.Error(err, "update repository")
return