DEV: Adapt to core bookmark changes (#280)

* Added can_see_bookmarkable? methods to BaseBookmarkable, implement
  that in QueryGroupBookmarkable
* Update spec to check that Notification for reminder has
  bookmarkable_id and bookmarkable_type

c.f. https://github.com/discourse/discourse/pull/25905
This commit is contained in:
Martin Brennan
2024-02-29 09:11:40 +10:00
committed by GitHub
parent 94e29e2143
commit f09e631636
3 changed files with 10 additions and 3 deletions
@@ -55,8 +55,12 @@ module ::DiscourseDataExplorer
end
def self.can_see?(guardian, bookmark)
return false if !bookmark.bookmarkable.group
guardian.user_is_a_member_of_group?(bookmark.bookmarkable.group)
can_see_bookmarkable?(guardian, bookmark.bookmarkable)
end
def self.can_see_bookmarkable?(guardian, bookmarkable)
return false if !bookmarkable.group
guardian.user_is_a_member_of_group?(bookmarkable.group)
end
end
end