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 (#18091)

Fix #18090

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
  • Loading branch information
zeripath and wxiaoguang authored Dec 24, 2021
1 parent d777053 commit 532383d
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 532383d

Please sign in to comment.