Skip to content

Commit e922729

Browse files
committed
When attempting to subscribe other user to issue report why access denied
Fix go-gitea#18090 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 7cc4449 commit e922729

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

routers/api/v1/repo/issue_subscription.go

Lines changed: 2 additions & 1 deletion
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)