|
|
@ -95,8 +95,8 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { |
|
|
|
} |
|
|
|
|
|
|
|
visibilityChanged := repo.IsPrivate != form.Private |
|
|
|
// when ForcePrivate enabled, you could change public repo to private, but could not change private to public
|
|
|
|
if visibilityChanged && setting.Repository.ForcePrivate && !form.Private { |
|
|
|
// when ForcePrivate enabled, you could change public repo to private, but only admin users can change private to public
|
|
|
|
if visibilityChanged && setting.Repository.ForcePrivate && !form.Private && !ctx.User.IsAdmin { |
|
|
|
ctx.ServerError("Force Private enabled", errors.New("cannot change private repository to public")) |
|
|
|
return |
|
|
|
} |
|
|
|