From e9227293218f710ddf2c31dc68fb57260ece1e3f Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Fri, 24 Dec 2021 11:32:37 +0000 Subject: [PATCH] When attempting to subscribe other user to issue report why access denied Fix #18090 Signed-off-by: Andrew Thornton --- routers/api/v1/repo/issue_subscription.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/api/v1/repo/issue_subscription.go b/routers/api/v1/repo/issue_subscription.go index ff305c48772d..9c6b4e464711 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 }