diff options
Diffstat (limited to 'routers/api/v1/notify/threads.go')
-rw-r--r-- | routers/api/v1/notify/threads.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/v1/notify/threads.go b/routers/api/v1/notify/threads.go index 5bfdd4d963..fe89304dc8 100644 --- a/routers/api/v1/notify/threads.go +++ b/routers/api/v1/notify/threads.go @@ -87,7 +87,7 @@ func ReadThread(ctx *context.APIContext) { targetStatus = models.NotificationStatusRead } - notif, err := models.SetNotificationStatus(n.ID, ctx.User, targetStatus) + notif, err := models.SetNotificationStatus(n.ID, ctx.Doer, targetStatus) if err != nil { ctx.InternalServerError(err) return @@ -109,7 +109,7 @@ func getThread(ctx *context.APIContext) *models.Notification { } return nil } - if n.UserID != ctx.User.ID && !ctx.User.IsAdmin { + if n.UserID != ctx.Doer.ID && !ctx.Doer.IsAdmin { ctx.Error(http.StatusForbidden, "GetNotificationByID", fmt.Errorf("only user itself and admin are allowed to read/change this thread %d", n.ID)) return nil } |