summaryrefslogtreecommitdiff
path: root/app/controllers/comments_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/comments_controller.rb')
-rw-r--r--app/controllers/comments_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index b69053e..3c2f57d 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -4,7 +4,7 @@ class CommentsController < ApplicationController
def edit
@comment = Comment.find(params[:id])
- if (mod? && current_user.role >= @comment.author.role) || @comment.author.is?(current_user)
+ if mod? || @comment.author.is?(current_user)
else
flash[:alert] = "You are not allowed to edit this comment"
redirect_to @comment.blogpost
@@ -33,7 +33,7 @@ class CommentsController < ApplicationController
def update
@comment = Comment.find(params[:id])
- if (mod? && current_user.role >= @comment.author.role) || @comment.author.is?(current_user)
+ if mod? || @comment.author.is?(current_user)
@comment.user_editor = current_user
@comment.attributes = comment_params
old_content = @comment.content_was
@@ -55,7 +55,7 @@ class CommentsController < ApplicationController
def destroy
@comment = Comment.find(params[:id])
- if (mod? && current_user.role >= @comment.author.role) || @comment.author.is?(current_user)
+ if mod? || @comment.author.is?(current_user)
if @comment.destroy
flash[:notice] = "Comment deleted!"
else