Skip to content
Snippets Groups Projects
Unverified Commit 41df5d8c authored by Pierre-André Boissinot's avatar Pierre-André Boissinot Committed by GitHub
Browse files

Merge pull request #1449 from noesya/hide_publish_buttons

Masque les boutons de publication en l'absence de droits
parents 31449a3d 0e3f0986
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 || cannot?(: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 if !@page.published && 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