diff options
Diffstat (limited to 'app/finders/notes_finder.rb')
-rw-r--r-- | app/finders/notes_finder.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/finders/notes_finder.rb b/app/finders/notes_finder.rb index 81017290f12..3d764f67990 100644 --- a/app/finders/notes_finder.rb +++ b/app/finders/notes_finder.rb @@ -31,6 +31,7 @@ class NotesFinder notes = since_fetch_at(notes) notes = notes.with_notes_filter(@params[:notes_filter]) if notes_filter? notes = redact_internal(notes) + notes = notes.without_hidden if without_hidden_notes? sort(notes) end @@ -189,6 +190,13 @@ class NotesFinder notes.not_internal end + + def without_hidden_notes? + return false unless Feature.enabled?(:hidden_notes) + return false if @current_user&.can_admin_all_resources? + + true + end end NotesFinder.prepend_mod_with('NotesFinder') |