From 8f2bf884ab10d1e102b24ce649757e30fb446dab Mon Sep 17 00:00:00 2001 From: kilo Date: Thu, 9 Nov 2017 15:53:40 +0100 Subject: [PATCH] Stop using deprecated HasAdmin() function --- controllers/moderator/helpers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/moderator/helpers.go b/controllers/moderator/helpers.go index ded87655..97de3f3a 100644 --- a/controllers/moderator/helpers.go +++ b/controllers/moderator/helpers.go @@ -53,7 +53,7 @@ func torrentManyAction(c *gin.Context) { messages.AddErrorTf("errors", "no_status_exist", status) status = -1 } - if !currentUser.HasAdmin() { + if !currentUser.IsModerator() { if c.PostForm("status") != "" { // Condition to check if a user try to change torrent status without having the right permission if (status == models.TorrentStatusTrusted && !currentUser.IsTrusted()) || status == models.TorrentStatusAPlus || status == 0 { status = models.TorrentStatusNormal @@ -64,7 +64,7 @@ func torrentManyAction(c *gin.Context) { } withReport = false // Users should not be able to remove reports } - if c.PostForm("owner") != "" && currentUser.HasAdmin() { // We check that the user given exist and if not we return an error + if c.PostForm("owner") != "" && currentUser.IsModerator() { // We check that the user given exist and if not we return an error _, _, errorUser := users.FindForAdmin(uint(owner)) if errorUser != nil { messages.AddErrorTf("errors", "no_user_found_id", owner)