0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-28 18:14:22 +01:00
gitea/models/issues
Lunny Xiao dd30d9d5c0
Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220)
The function `GetByBean` has an obvious defect that when the fields are
empty values, it will be ignored. Then users will get a wrong result
which is possibly used to make a security problem.

To avoid the possibility, this PR removed function `GetByBean` and all
references.
And some new generic functions have been introduced to be used.

The recommand usage like below.

```go
// if query an object according id
obj, err := db.GetByID[Object](ctx, id)
// query with other conditions
obj, err := db.Get[Object](ctx, builder.Eq{"a": a, "b":b})
```
2023-12-07 15:27:36 +08:00
..
assignees.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
assignees_test.go
comment.go Fix comment permissions (#28213) 2023-11-25 17:21:21 +00:00
comment_code.go
comment_list.go
comment_test.go
content_history.go Fix comment permissions (#28213) 2023-11-25 17:21:21 +00:00
content_history_test.go Fix comment permissions (#28213) 2023-11-25 17:21:21 +00:00
dependency.go
dependency_test.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
issue.go Display issue task list on project cards (#27865) 2023-11-02 11:42:02 +01:00
issue_index.go
issue_label.go
issue_label_test.go
issue_list.go
issue_list_test.go
issue_lock.go
issue_project.go Clean some functions about project issue (#27705) 2023-10-20 14:01:25 +02:00
issue_search.go Include public repos in doer's dashboard for issue search (#28304) 2023-12-07 13:26:18 +08:00
issue_stats.go
issue_test.go
issue_update.go
issue_user.go
issue_user_test.go
issue_watch.go
issue_watch_test.go
issue_xref.go
issue_xref_test.go
label.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
label_test.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
main_test.go
milestone.go
milestone_list.go
milestone_test.go
pull.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
pull_list.go
pull_test.go
reaction.go
reaction_test.go
review.go Fix 500 when deleting a dismissed review (#27903) 2023-11-05 13:25:40 +00:00
review_list.go
review_test.go Fix 500 when deleting a dismissed review (#27903) 2023-11-05 13:25:40 +00:00
stopwatch.go
stopwatch_test.go
tracked_time.go
tracked_time_test.go