Skip to content

Commit 532383d

Browse files
zeripathwxiaoguang
andauthored
When attempting to subscribe other user to issue report why access denied (#18091)
Fix #18090 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
1 parent d777053 commit 532383d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

routers/api/v1/repo/issue_subscription.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package repo
66

77
import (
8+
"fmt"
89
"net/http"
910

1011
"code.gitea.io/gitea/models"
@@ -128,7 +129,7 @@ func setIssueSubscription(ctx *context.APIContext, watch bool) {
128129

129130
//only admin and user for itself can change subscription
130131
if user.ID != ctx.User.ID && !ctx.User.IsAdmin {
131-
ctx.Error(http.StatusForbidden, "User", nil)
132+
ctx.Error(http.StatusForbidden, "User", fmt.Errorf("%s is not permitted to change subscriptions for %s", ctx.User.Name, user.Name))
132133
return
133134
}
134135

0 commit comments

Comments
 (0)