search: fix searches for private favgroups raising privilege errors.

Change favgroup:<name> searches to return no results instead of raising
a UserPrivilege error when an unpermitted user searches for a private
favgroup.

Partial fix for #4389.
This commit is contained in:
evazion
2020-04-16 18:55:53 -05:00
parent 3aa80c8dc4
commit f8d420d6c0
4 changed files with 46 additions and 23 deletions

View File

@@ -52,7 +52,7 @@ module PostSets
name = Tag.has_metatag?(tag_array, :favgroup)
return nil unless is_single_tag? && name.present?
@favgroup ||= FavoriteGroup.find_by_name_or_id(name, CurrentUser.user)
@favgroup ||= FavoriteGroup.visible(CurrentUser.user).find_by_name_or_id(name, CurrentUser.user)
end
def has_explicit?