Skip to content

Commit 534a1fe

Browse files
author
Henry Goodman
committed
Update remaining new whitelist -> allowlist refs
1 parent 4546f15 commit 534a1fe

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

models/git/protected_branch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ func removeIDsFromProtectedBranch(ctx context.Context, p *ProtectedBranch, userI
553553
func RemoveUserIDFromProtectedBranch(ctx context.Context, p *ProtectedBranch, userID int64) error {
554554
columnNames := []string{
555555
"whitelist_user_i_ds",
556-
"force_push_whitelist_user_i_ds",
556+
"force_push_allowlist_user_i_ds",
557557
"merge_whitelist_user_i_ds",
558558
"approvals_whitelist_user_i_ds",
559559
}
@@ -564,7 +564,7 @@ func RemoveUserIDFromProtectedBranch(ctx context.Context, p *ProtectedBranch, us
564564
func RemoveTeamIDFromProtectedBranch(ctx context.Context, p *ProtectedBranch, teamID int64) error {
565565
columnNames := []string{
566566
"whitelist_team_i_ds",
567-
"force_push_whitelist_team_i_ds",
567+
"force_push_allowlist_team_i_ds",
568568
"merge_whitelist_team_i_ds",
569569
"approvals_whitelist_team_i_ds",
570570
}

options/locale/locale_en-US.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2387,7 +2387,7 @@ settings.protect_whitelist_committers_desc = Only allowlisted users or teams wil
23872387
settings.protect_whitelist_deploy_keys = Allowlist deploy keys with write access to push.
23882388
settings.protect_whitelist_users = Allowlisted users for pushing:
23892389
settings.protect_whitelist_teams = Allowlisted teams for pushing:
2390-
settings.protect_force_push_whitelist_users = Allowlisted users for force pushing:
2390+
settings.protect_force_push_allowlist_users = Allowlisted users for force pushing:
23912391
settings.protect_force_push_allowlist_teams = Allowlisted teams for force pushing:
23922392
settings.protect_force_push_allowlist_deploy_keys = Allowlist deploy keys with push access to force push.
23932393
settings.protect_merge_whitelist_committers = Enable Merge Allowlist

routers/web/repo/setting/protected_branch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func SettingsProtectedBranch(c *context.Context) {
7777
}
7878
c.Data["Users"] = users
7979
c.Data["whitelist_users"] = strings.Join(base.Int64sToStrings(rule.WhitelistUserIDs), ",")
80-
c.Data["force_push_whitelist_users"] = strings.Join(base.Int64sToStrings(rule.ForcePushAllowlistUserIDs), ",")
80+
c.Data["force_push_allowlist_users"] = strings.Join(base.Int64sToStrings(rule.ForcePushAllowlistUserIDs), ",")
8181
c.Data["merge_whitelist_users"] = strings.Join(base.Int64sToStrings(rule.MergeWhitelistUserIDs), ",")
8282
c.Data["approvals_whitelist_users"] = strings.Join(base.Int64sToStrings(rule.ApprovalsWhitelistUserIDs), ",")
8383
c.Data["status_check_contexts"] = strings.Join(rule.StatusCheckContexts, "\n")

templates/repo/settings/protected_branch.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,31 +97,31 @@
9797
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_force_push"}}</h5>
9898
<div class="field">
9999
<div class="ui radio checkbox">
100-
<input type="radio" name="enable_force_push" value="none" class="toggle-target-disabled" data-target="#force_push_whitelist_box" {{if not .Rule.CanForcePush}}checked{{end}}>
100+
<input type="radio" name="enable_force_push" value="none" class="toggle-target-disabled" data-target="#force_push_allowlist_box" {{if not .Rule.CanForcePush}}checked{{end}}>
101101
<label>{{ctx.Locale.Tr "repo.settings.protect_disable_force_push"}}</label>
102102
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_disable_force_push_desc"}}</p>
103103
</div>
104104
</div>
105105
<div class="field">
106106
<div class="ui radio checkbox">
107-
<input type="radio" name="enable_force_push" value="all" class="toggle-target-disabled" data-target="#force_push_whitelist_box" {{if and (.Rule.CanForcePush) (not .Rule.EnableForcePushAllowlist)}}checked{{end}}>
107+
<input type="radio" name="enable_force_push" value="all" class="toggle-target-disabled" data-target="#force_push_allowlist_box" {{if and (.Rule.CanForcePush) (not .Rule.EnableForcePushAllowlist)}}checked{{end}}>
108108
<label>{{ctx.Locale.Tr "repo.settings.protect_enable_force_push_all"}}</label>
109109
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_force_push_all_desc"}}</p>
110110
</div>
111111
</div>
112112
<div class="grouped fields">
113113
<div class="field">
114114
<div class="ui radio checkbox">
115-
<input type="radio" name="enable_force_push" value="whitelist" class="toggle-target-enabled" data-target="#force_push_whitelist_box" {{if and (.Rule.CanForcePush) (.Rule.EnableForcePushAllowlist)}}checked{{end}}>
115+
<input type="radio" name="enable_force_push" value="whitelist" class="toggle-target-enabled" data-target="#force_push_allowlist_box" {{if and (.Rule.CanForcePush) (.Rule.EnableForcePushAllowlist)}}checked{{end}}>
116116
<label>{{ctx.Locale.Tr "repo.settings.protect_enable_force_push_allowlist"}}</label>
117117
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_force_push_allowlist_desc"}}</p>
118118
</div>
119119
</div>
120-
<div id="force_push_whitelist_box" class="grouped fields {{if not .Rule.EnableForcePushAllowlist}}disabled{{end}}">
120+
<div id="force_push_allowlist_box" class="grouped fields {{if not .Rule.EnableForcePushAllowlist}}disabled{{end}}">
121121
<div class="checkbox-sub-item field">
122-
<label>{{ctx.Locale.Tr "repo.settings.protect_force_push_whitelist_users"}}</label>
122+
<label>{{ctx.Locale.Tr "repo.settings.protect_force_push_allowlist_users"}}</label>
123123
<div class="ui multiple search selection dropdown">
124-
<input type="hidden" name="force_push_whitelist_users" value="{{.force_push_whitelist_users}}">
124+
<input type="hidden" name="force_push_allowlist_users" value="{{.force_push_allowlist_users}}">
125125
<div class="default text">{{ctx.Locale.Tr "search.user_kind"}}</div>
126126
<div class="menu">
127127
{{range .Users}}

tests/integration/git_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ func doProtectBranch(ctx APITestContext, branch, userToWhitelistPush, userToWhit
481481
if userToWhitelistForcePush != "" {
482482
user, err := user_model.GetUserByName(db.DefaultContext, userToWhitelistForcePush)
483483
assert.NoError(t, err)
484-
formData["force_push_whitelist_users"] = strconv.FormatInt(user.ID, 10)
484+
formData["force_push_allowlist_users"] = strconv.FormatInt(user.ID, 10)
485485
formData["enable_force_push"] = "whitelist"
486486
formData["enable_force_push_allowlist"] = "on"
487487
}

0 commit comments

Comments
 (0)