forgejo/models/issues
Gusted d7e483fd52 [v7.0/forgejo] fix: consider public issues for project boards (#7143) (#7145)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/7143

- The security patch of forgejo/forgejo#6843 fixed the issue where project boards loaded all issues without considering if the doer actually had permission to view that issue. Within that patch the call to `Issues` was modified to include this permission checking.
- The query being generated was not entirely correct. Issues in public repositories weren't considered correctly (partly the fault of not setting `AllPublic` unconditionally) in the cause an authenticated user loaded the project.
- This is now fixed by setting `AllPublic` unconditionally and subsequently fixing the `Issue` function to ensure that the combination of setting `AllPublic` and `User` generates the correct query, by combining the permission check and issues in public repositories as one `AND` query.
- Added unit testing.
- Added integration testing.
- Resolves Codeberg/Community#1809
- Regression of https://codeberg.org/forgejo/forgejo/pulls/6843

(cherry picked from commit a2958f5a26)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7145
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-03-07 00:20:25 +00: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 enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
comment.go remove util.OptionalBool and related functions (#29513) 2024-03-06 12:10:46 +08:00
comment_code.go Load attachments for code comments (#30124) 2024-03-30 07:17:31 +01:00
comment_list.go Use ghost user if user was not found (#29161) 2024-02-16 15:20:52 +01:00
comment_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
content_history.go [BUG] Ensure HasIssueContentHistory takes into account comment_id 2024-02-29 18:23:06 +01:00
content_history_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
dependency.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
dependency_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
issue.go Do not update PRs based on events that happened before they existed 2024-04-12 10:41:19 +02:00
issue_index.go Do not update PRs based on events that happened before they existed 2024-04-12 10:41:19 +02:00
issue_index_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
issue_label.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
issue_label_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
issue_list.go Performance improvements for pull request list page (#29900) 2024-03-26 19:04:26 +01:00
issue_list_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
issue_lock.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
issue_project.go [v7.0/forgejo] fix: consider public issues for project boards (#7143) (#7145) 2025-03-07 00:20:25 +00:00
issue_project_test.go [v7.0/forgejo] fix: consider public issues for project boards (#7143) (#7145) 2025-03-07 00:20:25 +00:00
issue_search.go [v7.0/forgejo] fix: consider public issues for project boards (#7143) (#7145) 2025-03-07 00:20:25 +00:00
issue_stats.go [v7.0/forgejo] Fix bug in GetIssueStats (#4152) 2024-06-16 19:06:43 +00:00
issue_stats_test.go [v7.0/forgejo] Fix bug in GetIssueStats (#4152) 2024-06-16 19:06:43 +00:00
issue_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
issue_update.go Fix no edit history after editing issue's title and content (#30814) 2024-05-07 08:21:38 +01:00
issue_user.go Add combined index for issue_user.uid and issue_id (#28080) 2023-12-14 09:26:59 +00:00
issue_user_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
issue_watch.go Even more db.DefaultContext refactor (#27352) 2023-10-03 10:30:41 +00:00
issue_watch_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
issue_xref.go [CLEANUP] make golangci-lint@v1.56.1 happy 2024-02-15 16:19:36 +01:00
issue_xref_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
label.go [GITEA] Apply changes to archived labels 2024-04-03 20:14:39 +00:00
label_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
main_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
milestone.go remove util.OptionalBool and related functions (#29513) 2024-03-06 12:10:46 +08:00
milestone_list.go remove util.OptionalBool and related functions (#29513) 2024-03-06 12:10:46 +08:00
milestone_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
pull.go [Port] gitea#29842: Notify reviewers added via CODEOWNERS 2024-03-28 14:58:39 +01:00
pull_list.go Do not update PRs based on events that happened before they existed 2024-04-12 10:41:19 +02:00
pull_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
reaction.go [MODERATION] User blocking 2024-02-05 15:56:45 +01:00
reaction_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
review.go Prevent re-review and dismiss review actions on closed and merged PRs (#30065) 2024-03-30 07:17:32 +01:00
review_list.go remove util.OptionalBool and related functions (#29513) 2024-03-06 12:10:46 +08:00
review_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
stopwatch.go Remove deadcode under models/issues (#28536) 2023-12-19 20:12:02 +01:00
stopwatch_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
tracked_time.go remove util.OptionalBool and related functions (#29513) 2024-03-06 12:10:46 +08:00
tracked_time_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00