Stop using deprecated HasAdmin() function
Cette révision appartient à :
Parent
6ffcfc7a39
révision
8f2bf884ab
1 fichiers modifiés avec 2 ajouts et 2 suppressions
|
@ -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)
|
||||
|
|
Référencer dans un nouveau ticket