Skip to content

Commit

Permalink
When attempting to subscribe other user to issue report why access de…
Browse files Browse the repository at this point in the history
…nied (go-gitea#18091)

Fix go-gitea#18090

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
  • Loading branch information
2 people authored and Stelios Malathouras committed Mar 28, 2022
1 parent 8975764 commit 3cfaaf3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion routers/api/v1/repo/issue_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package repo

import (
"fmt"
"net/http"

"code.gitea.io/gitea/models"
Expand Down Expand Up @@ -128,7 +129,7 @@ func setIssueSubscription(ctx *context.APIContext, watch bool) {

//only admin and user for itself can change subscription
if user.ID != ctx.User.ID && !ctx.User.IsAdmin {
ctx.Error(http.StatusForbidden, "User", nil)
ctx.Error(http.StatusForbidden, "User", fmt.Errorf("%s is not permitted to change subscriptions for %s", ctx.User.Name, user.Name))
return
}

Expand Down

0 comments on commit 3cfaaf3

Please sign in to comment.