File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 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) {
168168 actionsConfig := ctx .Repo .Repository .MustGetUnit (ctx , unit .TypeActions ).ActionsConfig ()
169169 ctx .Data ["ActionsConfig" ] = actionsConfig
170170
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 ()
173173 isWorkflowDisabled := actionsConfig .IsWorkflowDisabled (workflowID )
174174 ctx .Data ["CurWorkflowDisabled" ] = isWorkflowDisabled
175175
Original file line number Diff line number Diff line change @@ -1406,7 +1406,7 @@ func registerRoutes(m *web.Router) {
14061406 m .Get ("" , actions .List )
14071407 m .Post ("/disable" , reqRepoAdmin , actions .DisableWorkflowFile )
14081408 m .Post ("/enable" , reqRepoAdmin , actions .EnableWorkflowFile )
1409- m .Post ("/run" , reqRepoAdmin , actions .Run )
1409+ m .Post ("/run" , reqRepoActionsWriter , actions .Run )
14101410
14111411 m .Group ("/runs/{run}" , func () {
14121412 m .Combo ("" ).
You can’t perform that action at this time.
0 commit comments