fix edit link permission checks for comments, threads, replies

This commit is contained in:
jomo
2016-07-19 15:06:40 +02:00
parent f2353eebcc
commit 76076bbdf2
3 changed files with 3 additions and 3 deletions

View File

@@ -6,7 +6,7 @@
<%= ago c.created_at %>
<% end %>
<%= link_to "edit", edit_blogpost_comment_path(c.blogpost, c), class: "editlink" if (mod? || c.author.is?(current_user)) %>
<%= link_to "edit", edit_blogpost_comment_path(c.blogpost, c), class: "editlink" if (mod? && current_user.role >= c.author.role) || c.author.is?(current_user) %>
<div class="clear-right"></div>
</div>
<div class="items">

View File

@@ -8,7 +8,7 @@
<%= link_to p do %>
<%= ago @thread.created_at %>
<% end %>
<%= link_to "edit", edit_forumthread_path( @thread), class: "editlink" if (@thread.author.is?(current_user) || mod?) %>
<%= link_to "edit", edit_forumthread_path( @thread), class: "editlink" if (mod? && current_user.role >= @thread.author.role) || @thread.author.is?(current_user) %>
<div class="clear-right"></div>
</div>
<div class="items">

View File

@@ -6,7 +6,7 @@
<%= ago reply.created_at %>
<% end %>
<%= link_to "edit", edit_forumthread_threadreply_path(reply.thread, reply), class: "editlink" if mod? || reply.author.is?(current_user) %>
<%= link_to "edit", edit_forumthread_threadreply_path(reply.thread, reply), class: "editlink" if (mod? && current_user.role >= reply.author.role) || reply.author.is?(current_user) %>
<div class="clear-right"></div>
</div>
<div class="items">