Merge pull request #3433 from BrokenEagle/fix-fav-privacy

Fix incorrect showing of favorites and favorite groups with privacy settings enabled
This commit is contained in:
Albert Yi
2017-12-18 14:58:54 -08:00
committed by GitHub
4 changed files with 44 additions and 11 deletions

View File

@@ -241,4 +241,8 @@ class FavoriteGroup < ApplicationRecord
def editable_by?(user)
creator_id == user.id
end
def viewable_by?(user)
creator_id == user.id || !creator.hide_favorites?
end
end