mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-26 21:44:44 +00:00
add admin checkbox for setting a repo privileged
This commit is contained in:
parent
cccf0fb610
commit
e0c9617dc7
2 changed files with 12 additions and 1 deletions
|
@ -229,6 +229,8 @@ func RepoUpdate(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) err
|
||||||
repo.Disabled = len(r.FormValue("Disabled")) == 0
|
repo.Disabled = len(r.FormValue("Disabled")) == 0
|
||||||
repo.DisabledPullRequest = len(r.FormValue("DisabledPullRequest")) == 0
|
repo.DisabledPullRequest = len(r.FormValue("DisabledPullRequest")) == 0
|
||||||
|
|
||||||
|
repo.Privileged = u.Admin && len(r.FormValue("Privileged")) > 0
|
||||||
|
|
||||||
// value of "" indicates the currently authenticated user
|
// value of "" indicates the currently authenticated user
|
||||||
// should be set as the administrator.
|
// should be set as the administrator.
|
||||||
if len(r.FormValue("Owner")) == 0 {
|
if len(r.FormValue("Owner")) == 0 {
|
||||||
|
|
|
@ -43,6 +43,15 @@
|
||||||
Enable Pull Hooks
|
Enable Pull Hooks
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
{{ if .User.Admin }}
|
||||||
|
<div class="alert alert-min">Admin-only settings.</div>
|
||||||
|
<div class="checkbox form-group">
|
||||||
|
<label>
|
||||||
|
<input class="" type="checkbox" name="Privileged" {{ if .Repo.Privileged }}checked="True" {{ end }}/>
|
||||||
|
Enable Privileged Builds
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
<div class="alert alert-min">Choose the account owner.</div>
|
<div class="alert alert-min">Choose the account owner.</div>
|
||||||
<div>
|
<div>
|
||||||
<ul class="account-radio-group">
|
<ul class="account-radio-group">
|
||||||
|
@ -100,4 +109,4 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue