File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -168,8 +168,8 @@ func List(ctx *context.Context) {
168
168
actionsConfig := ctx .Repo .Repository .MustGetUnit (ctx , unit .TypeActions ).ActionsConfig ()
169
169
ctx .Data ["ActionsConfig" ] = actionsConfig
170
170
171
- if len (workflowID ) > 0 && ctx .Repo .IsAdmin ( ) {
172
- ctx .Data ["AllowDisableOrEnableWorkflow" ] = true
171
+ if len (workflowID ) > 0 && ctx .Repo .CanWrite ( unit . TypeActions ) {
172
+ ctx .Data ["AllowDisableOrEnableWorkflow" ] = ctx . Repo . IsAdmin ()
173
173
isWorkflowDisabled := actionsConfig .IsWorkflowDisabled (workflowID )
174
174
ctx .Data ["CurWorkflowDisabled" ] = isWorkflowDisabled
175
175
Original file line number Diff line number Diff line change @@ -1406,7 +1406,7 @@ func registerRoutes(m *web.Router) {
1406
1406
m .Get ("" , actions .List )
1407
1407
m .Post ("/disable" , reqRepoAdmin , actions .DisableWorkflowFile )
1408
1408
m .Post ("/enable" , reqRepoAdmin , actions .EnableWorkflowFile )
1409
- m .Post ("/run" , reqRepoAdmin , actions .Run )
1409
+ m .Post ("/run" , reqRepoActionsWriter , actions .Run )
1410
1410
1411
1411
m .Group ("/runs/{run}" , func () {
1412
1412
m .Combo ("" ).
You can’t perform that action at this time.
0 commit comments