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

Fix go-gitea#18090

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Dec 24, 2021
1 parent 7cc4449 commit e922729
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 e922729

Please sign in to comment.