Merge pull request #4107 from tomhughes/diary-visibility
Allow administrators to see deleted diary entries
This commit is contained in:
commit
9619e699e1
3 changed files with 30 additions and 10 deletions
|
@ -56,7 +56,7 @@ class Ability
|
|||
can [:account, :go_public], User
|
||||
|
||||
if user.moderator?
|
||||
can [:hide, :hidecomment], DiaryEntry
|
||||
can [:hide, :unhide, :hidecomment, :unhidecomment], DiaryEntry
|
||||
can [:index, :show, :resolve, :ignore, :reopen], Issue
|
||||
can :create, IssueComment
|
||||
can [:new, :create, :edit, :update, :destroy], Redaction
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue