X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/925d12cc8176414d0f9531832862a5825783d132..6651d713d7255078ed7228119bd89230b5df846b:/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