mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-26 01:40:36 +00:00
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>
This commit is contained in:
parent
d7770539f6
commit
532383d7dd
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue