adds permissions in view for direct messages
This commit is contained in:
@@ -10,6 +10,7 @@ module Abilities
|
||||
can :read, Legislation
|
||||
can :read, User
|
||||
can [:search, :read], Annotation
|
||||
can :new, DirectMessage
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
receiver: @receiver.name) %>
|
||||
</h1>
|
||||
|
||||
<!-- if USER IS VERIFIED -->
|
||||
<% if can? :create, @direct_message %>
|
||||
<%= form_for [@receiver, @direct_message] do |f| %>
|
||||
<%= render "shared/errors", resource: @direct_message %>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<%= f.submit t("users.direct_messages.new.submit_button"), class: "button expanded" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- else -->
|
||||
<% else %>
|
||||
<div class="callout warning">
|
||||
<p>
|
||||
<%= t("users.direct_messages.new.verified_only",
|
||||
@@ -29,6 +29,6 @@
|
||||
verification_path )).html_safe %>
|
||||
</p>
|
||||
</div>
|
||||
<!-- end -->
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user