Skip to content
Snippets Groups Projects
Commit 590aafab authored by pabois's avatar pabois
Browse files

hide buttons

parent 31449a3d
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ module Admin::ApplicationHelper
end
def publish_link(object)
return if object.published
return if object.published || !can?(:publish, object)
link_to t('admin.communication.website.publish.button'),
[:publish, :admin, object],
method: :post,
......
......@@ -49,7 +49,7 @@
<%= link_to t('admin.communication.website.publish.button'),
publish_admin_communication_website_page_path(@page),
class: button_classes,
method: :post unless @page.published
method: :post unless @page.published if can?(:publish, @page)
# This is not edit_link @page because of the polymorphism of the special pages, which would create a wrong path
%>
<% end %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment