dmails: fix respond links being shown to non-owner on show page.

This commit is contained in:
evazion
2020-02-03 21:55:14 -06:00
parent df2573359d
commit 0321b979d0

View File

@@ -24,14 +24,16 @@
<% end %>
</div>
<p>
<%= link_to "Respond", new_dmail_path(:respond_to_id => @dmail) %>
| <%= link_to "Forward", new_dmail_path(:respond_to_id => @dmail, :forward => true) %>
| <%= link_to "Share", dmail_path(@dmail, key: @dmail.key), title: "Anyone with this link will be able to view this dmail." %>
<% if @dmail.reportable_by?(CurrentUser.user) %>
| <%= link_to "Report", new_moderation_report_path(moderation_report: { model_type: "Dmail", model_id: @dmail.id }), remote: true, title: "Report this dmail to the moderators" %>
<% end %>
</p>
<% if CurrentUser.user == @dmail.owner %>
<p>
<%= link_to "Respond", new_dmail_path(:respond_to_id => @dmail) %>
| <%= link_to "Forward", new_dmail_path(:respond_to_id => @dmail, :forward => true) %>
| <%= link_to "Share", dmail_path(@dmail, key: @dmail.key), title: "Anyone with this link will be able to view this dmail." %>
<% if @dmail.reportable_by?(CurrentUser.user) %>
| <%= link_to "Report", new_moderation_report_path(moderation_report: { model_type: "Dmail", model_id: @dmail.id }), remote: true, title: "Report this dmail to the moderators" %>
<% end %>
</p>
<% end %>
</div>
</div>
</div>