remove annoying permission check for comments, forums, threads, replies

This commit is contained in:
jomo
2016-07-24 22:30:00 +02:00
parent c9e7015f4c
commit b057cb5913
6 changed files with 12 additions and 12 deletions

View File

@@ -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