X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f29ba01eb90b1db5937aeaee3b625e8840715396..38369675b7b574c044a178d9f67ce91ed3d407c1:/app/controllers/diary_entries_controller.rb?ds=inline diff --git a/app/controllers/diary_entries_controller.rb b/app/controllers/diary_entries_controller.rb index f464cacd0..ea9aacb21 100644 --- a/app/controllers/diary_entries_controller.rb +++ b/app/controllers/diary_entries_controller.rb @@ -70,7 +70,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