mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-08 18:04:14 +01:00
Issue comment reactions should also check pull type (#13349)
* Migrating reactions is just not that important A failure during migrating reactions should not cause failure of migration. Signed-off-by: Andrew Thornton <art27@cantab.net> * When checking issue reactions check the correct permission Signed-off-by: Andrew Thornton <art27@cantab.net> * And there is another one ... Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
4b33afcd5b
commit
55801cf4eb
1 changed files with 5 additions and 1 deletions
|
@ -57,7 +57,11 @@ func GetIssueCommentReactions(ctx *context.APIContext) {
|
|||
return
|
||||
}
|
||||
|
||||
if !ctx.Repo.CanRead(models.UnitTypeIssues) {
|
||||
if err := comment.LoadIssue(); err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "comment.LoadIssue", err)
|
||||
}
|
||||
|
||||
if !ctx.Repo.CanReadIssuesOrPulls(comment.Issue.IsPull) {
|
||||
ctx.Error(http.StatusForbidden, "GetIssueCommentReactions", errors.New("no permission to get reactions"))
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue