Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AO3-6004 show hidden bookmarks on a bookmarkable to admins #4758

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
5 changes: 3 additions & 2 deletions app/controllers/bookmarks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ def search

def index
if @bookmarkable
access_denied unless is_admin? || @bookmarkable.visible?
@bookmarks = @bookmarkable.bookmarks.is_public.order_by_created_at.paginate(page: params[:page], per_page: ArchiveConfig.ITEMS_PER_PAGE)
access_denied unless logged_in_as_admin? || @bookmarkable.visible?
@bookmarks = @bookmarkable.bookmarks.not_private.order_by_created_at.paginate(page: params[:page], per_page: ArchiveConfig.ITEMS_PER_PAGE)
@bookmarks = @bookmarks.where(hidden_by_admin: false) unless logged_in_as_admin?
else
base_options = {
show_private: (@user.present? && @user == current_user),
Expand Down
2 changes: 2 additions & 0 deletions features/admins/admin_works.feature
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ Feature: Admin Actions for Works, Comments, Series, Bookmarks
When I follow "Hide Bookmark"
And all indexing jobs have been run
Then I should see "Item has been hidden."
And I should see "Make Bookmark Visible"
walshyb marked this conversation as resolved.
Show resolved Hide resolved
And I should see "Rude comment"
When I am logged in as "regular_user" with password "password1"
And I am on bad_user's bookmarks page
Then I should not see "Rude comment"
Expand Down
Loading