forgejo/models
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
..
actions chore(refactor): remove deadcode from port of Add API for Variables (#29520) 2025-02-08 07:50:19 +00:00
activities Update golang packages to v1.23 (v7.0/forgejo) (minor) (#7081) 2025-03-04 22:15:29 +00:00
admin Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
asymkey Update golang packages to v1.23 (v7.0/forgejo) (minor) (#7081) 2025-03-04 22:15:29 +00:00
auth Update golang packages to v1.23 (v7.0/forgejo) (minor) (#7081) 2025-03-04 22:15:29 +00:00
avatars enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
db enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
dbfs enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
fixtures [v7.0/forgejo] fix: consider public issues for project boards (#7143) (#7145) 2025-03-07 00:20:25 +00:00
forgejo/semver enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
forgejo_migrations enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
git Update golang packages to v1.23 (v7.0/forgejo) (minor) (#7081) 2025-03-04 22:15:29 +00:00
issues [v7.0/forgejo] fix: consider public issues for project boards (#7143) (#7145) 2025-03-07 00:20:25 +00:00
migrations Update golang packages to v1.23 (v7.0/forgejo) (minor) (#7081) 2025-03-04 22:15:29 +00:00
organization enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
packages enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
perm enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
project Update golang packages to v1.23 (v7.0/forgejo) (minor) (#7081) 2025-03-04 22:15:29 +00:00
pull [GITEA] GetScheduledMergeByPullID may involve a system user 2024-02-05 16:09:41 +01:00
repo Update golang packages to v1.23 (v7.0/forgejo) (minor) (#7081) 2025-03-04 22:15:29 +00:00
secret Make runs-on support variable expression (#29468) 2024-03-11 23:36:59 +07:00
shared/types Refactor locale&string&template related code (#29165) 2024-02-16 15:20:52 +01:00
system enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
unit enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
unittest enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
user Update golang packages to v1.23 (v7.0/forgejo) (minor) (#7081) 2025-03-04 22:15:29 +00:00
webhook enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
error.go Add merge style fast-forward-only (#28954) 2024-02-14 17:19:19 +01:00
fixture_generation.go Replace more db.DefaultContext (#27628) 2023-10-15 17:46:06 +02:00
fixture_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
org.go Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
org_team.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
org_team_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
org_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
repo.go Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
repo_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00
repo_transfer.go [MODERATION] User blocking 2024-02-05 15:56:45 +01:00
repo_transfer_test.go enable linter testifylint on v7 (#4572) 2024-07-30 19:42:06 +00:00