mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-15 18:56:59 +00:00
fix: consider public issues for project boards (#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 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7143 Reviewed-by: Otto <otto@codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
b10454a00c
commit
a2958f5a26
6 changed files with 76 additions and 27 deletions
|
@ -56,12 +56,11 @@ func LoadIssuesFromColumn(ctx context.Context, b *project_model.Column, doer *us
|
|||
ProjectID: b.ProjectID,
|
||||
SortType: "project-column-sorting",
|
||||
IsClosed: isClosed,
|
||||
AllPublic: true,
|
||||
}
|
||||
if doer != nil {
|
||||
issueOpts.User = doer
|
||||
issueOpts.Org = org
|
||||
} else {
|
||||
issueOpts.AllPublic = true
|
||||
}
|
||||
|
||||
issueList, err := Issues(ctx, issueOpts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue