mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 14:03:24 +09:00
fix(markup): enforce same-repository issue access (#39045)
Enforce Issues and Pull Requests access for references within the current repository. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
silverwind
wxiaoguang
parent
5fc3cec87f
commit
9251eeb66b
@@ -42,14 +42,15 @@ func renderRepoIssueIconTitle(ctx context.Context, opts markup.RenderIssueIconTi
|
||||
return "", err
|
||||
}
|
||||
|
||||
permission := webCtx.Repo.Permission
|
||||
if webCtx.Repo.Repository == nil || dbRepo.ID != webCtx.Repo.Repository.ID {
|
||||
perms, err := access.GetDoerRepoPermission(ctx, dbRepo, webCtx.Doer)
|
||||
permission, err = access.GetDoerRepoPermission(ctx, dbRepo, webCtx.Doer)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if !perms.CanReadIssuesOrPulls(issue.IsPull) {
|
||||
return "", util.ErrPermissionDenied
|
||||
}
|
||||
}
|
||||
if !permission.CanReadIssuesOrPulls(issue.IsPull) {
|
||||
return "", util.ErrPermissionDenied
|
||||
}
|
||||
|
||||
if issue.IsPull {
|
||||
|
||||
Reference in New Issue
Block a user