discourse/lib/guardian/bookmark_guardian.rb
David Taylor 5db41cd578
SECURITY: Respect topic permissions when loading bookmark metadata
Co-authored-by: Martin Brennan <martin@discourse.org>
Co-authored-by: Sam Saffron <sam.saffron@gmail.com>
2020-03-23 11:30:48 +00:00

12 lines
208 B
Ruby

# frozen_string_literal: true
module BookmarkGuardian
def can_delete_bookmark?(bookmark)
@user == bookmark.user
end
def can_create_bookmark?(bookmark)
can_see_topic?(bookmark.topic)
end
end