check mod+ rank when updating comment

This commit is contained in:
jomo
2016-07-19 14:50:03 +02:00
parent d9ae4e7d3a
commit 072f38a373

View File

@@ -33,7 +33,7 @@ class CommentsController < ApplicationController
def update
@comment = Comment.find(params[:id])
if mod? || @comment.author.is?(current_user)
if (mod? && current_user.role >= @comment.author.role) || @comment.author.is?(current_user)
@comment.user_editor = current_user
@comment.attributes = comment_params
old_content = @comment.content_was