X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/dc28f1dccc5589afa667bf6959f12e6b18589459..9619e699e1daf2ec1127cdf0bba7ffe2aa3bbb0c:/app/controllers/diary_entries_controller.rb diff --git a/app/controllers/diary_entries_controller.rb b/app/controllers/diary_entries_controller.rb index 4cdc1b55a..6e7378bf3 100644 --- a/app/controllers/diary_entries_controller.rb +++ b/app/controllers/diary_entries_controller.rb @@ -62,7 +62,9 @@ class DiaryEntriesController < ApplicationController end def show - @entry = @user.diary_entries.visible.where(:id => params[:id]).first + entries = @user.diary_entries + entries = entries.visible unless can? :unhide, DiaryEntry + @entry = entries.where(:id => params[:id]).first if @entry @title = t ".title", :user => params[:display_name], :title => @entry.title @comments = can?(:unhidecomment, DiaryEntry) ? @entry.comments : @entry.visible_comments