diff --git a/sqle/api/controller/v1/project_permission.go b/sqle/api/controller/v1/project_permission.go index cf3b5c3253..1f99efe20f 100644 --- a/sqle/api/controller/v1/project_permission.go +++ b/sqle/api/controller/v1/project_permission.go @@ -82,7 +82,7 @@ func CheckCurrentUserCanOperateWorkflow(c echo.Context, project *model.Project, if err != nil { return err } - ok, err := s.CheckUserHasOpToInstances(user, instances, ops) + ok, err := s.CheckUserHasOpToAnyInstance(user, instances, ops) if err != nil { return err } @@ -129,7 +129,12 @@ func checkCurrentUserCanAccessTask(c echo.Context, task *model.Task, ops []uint) return nil } if len(ops) > 0 { - ok, err := s.CheckUserHasOpToInstances(user, []*model.Instance{task.Instance}, ops) + instList, err := s.GetInstancesByWorkflowID(workflow.ID) + if err != nil { + return err + } + + ok, err := s.CheckUserHasOpToAnyInstance(user, instList, ops) if err != nil { return err }