summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-12-24 13:47:42 +0000
committerGitHub <noreply@github.com>2021-12-24 21:47:42 +0800
commit532383d7ddca2eeed37d2af20cd91f2824fc9cc7 (patch)
treeba661fd68e34bf5315f35c39eb880ccccb4130aa /routers
parentd7770539f6497e9181d6293700099ac742b03a81 (diff)
downloadgitea-532383d7ddca2eeed37d2af20cd91f2824fc9cc7.tar.gz
gitea-532383d7ddca2eeed37d2af20cd91f2824fc9cc7.zip
When attempting to subscribe other user to issue report why access denied (#18091)
Fix #18090 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/repo/issue_subscription.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/api/v1/repo/issue_subscription.go b/routers/api/v1/repo/issue_subscription.go
index ff305c4877..9c6b4e4647 100644
--- a/routers/api/v1/repo/issue_subscription.go
+++ b/routers/api/v1/repo/issue_subscription.go
@@ -5,6 +5,7 @@
package repo
import (
+ "fmt"
"net/http"
"code.gitea.io/gitea/models"
@@ -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
}