diff --git a/app/views/wiki_pages/show.html.erb b/app/views/wiki_pages/show.html.erb index d3d01eaa2..ebde6adb2 100644 --- a/app/views/wiki_pages/show.html.erb +++ b/app/views/wiki_pages/show.html.erb @@ -27,7 +27,11 @@ <% end %> <% if @wiki_page.new_record? %> -

This wiki page does not exist. <%= link_to "Create new wiki page", new_wiki_page_path(wiki_page: { title: @wiki_page.title }), rel: "nofollow" %>.

+

This wiki page does not exist. + <% if policy(@wiki_page).create? %> + <%= link_to "Create new wiki page", new_wiki_page_path(wiki_page: { title: @wiki_page.title }), rel: "nofollow" %>.

+ <% end %> +

<% else %> <%= format_text(@wiki_page.body) %> <% end %>