Skip to content

Commit

Permalink
chore:Having the permission of any data source in the work order is d…
Browse files Browse the repository at this point in the history
…eemed to be able to operate the workflow
  • Loading branch information
taolx0 committed Aug 1, 2023
1 parent c214825 commit 0ee31db
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sqle/api/controller/v1/project_permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 0ee31db

Please sign in to comment.