fixbug
This commit is contained in:
@@ -399,6 +399,8 @@ func repoAssignment(ctx *Context, repo *repo_model.Repository) {
|
||||
ctx.Data["Permission"] = &ctx.Repo.Permission
|
||||
if ctx.Doer != nil {
|
||||
ctx.Data["AllowCreateDevcontainer"] = ctx.Doer.AllowCreateDevcontainer
|
||||
ctx.Data["AllowCreateActRunner"] = ctx.Doer.AllowCreateActRunner
|
||||
|
||||
} else {
|
||||
query := ctx.Req.URL.Query()
|
||||
userID := query.Get("user")
|
||||
@@ -416,6 +418,7 @@ func repoAssignment(ctx *Context, repo *repo_model.Repository) {
|
||||
return
|
||||
}
|
||||
ctx.Data["AllowCreateDevcontainer"] = u.AllowCreateDevcontainer
|
||||
ctx.Data["AllowCreateActRunner"] = u.AllowCreateActRunner
|
||||
}
|
||||
|
||||
if repo.IsMirror {
|
||||
|
||||
@@ -9,9 +9,19 @@
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</button>
|
||||
<div class="menu">
|
||||
<div style="color: red; border: 1px solid red; padding: 10px; margin: 10px 0;">
|
||||
<h4>权限调试信息:</h4>
|
||||
<div>当前用户: {{if .Doer}}{{.Doer.Name}}{{else}}未登录{{end}}</div>
|
||||
<div>AllowCreateActRunner: {{.AllowCreateActRunner}}</div>
|
||||
<div>Permission.IsAdmin: {{.Permission.IsAdmin}}</div>
|
||||
<div>or条件结果: {{or .AllowCreateActRunner .Permission.IsAdmin}}</div>
|
||||
<div>Doer对象: {{printf "%+v" .Doer}}</div>
|
||||
</div>
|
||||
{{if (.Permission.IsAdmin)}}
|
||||
<div class="item">
|
||||
<a href="{{$.Link}}/regist_runner">{{ctx.Locale.Tr "actions.runners.regist_runner"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="item">
|
||||
<a href="https://docs.gitea.com/usage/actions/act-runner">{{ctx.Locale.Tr "actions.runners.new_notice"}}</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user