]> source.dussan.org Git - gitea.git/commitdiff
When attempting to subscribe other user to issue report why access denied (#18091)
authorzeripath <art27@cantab.net>
Fri, 24 Dec 2021 13:47:42 +0000 (13:47 +0000)
committerGitHub <noreply@github.com>
Fri, 24 Dec 2021 13:47:42 +0000 (21:47 +0800)
Fix #18090

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
routers/api/v1/repo/issue_subscription.go

index ff305c48772d11338a4ebae2d1bbf5c0a590d564..9c6b4e464711a5073f1405bcf56e890d4675d66b 100644 (file)
@@ -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
        }