Added privilege check for seeing flagger usernames

Also reworked all places dealing with flagger names to use said privilege
This commit is contained in:
Type-kun
2017-06-14 20:43:25 +05:00
parent 5d4592e0e0
commit 1375cc5307
8 changed files with 42 additions and 16 deletions

View File

@@ -39,7 +39,7 @@
</td>
<td>
<%= compact_time post_flag.created_at %>
<% if CurrentUser.user.is_moderator? %>
<% if CurrentUser.can_view_flagger?(post_flag.creator_id) %>
<br> by <%= link_to_user post_flag.creator %>
<%= link_to "»", post_flags_path(search: params[:search].merge(creator_name: post_flag.creator.name)) %>
<% end %>