discourse/lib/guardian/bookmark_guardian.rb
Ted Johansson a93b6a2214
DEV: Consistently use Guardian helper methods (#34024)
1. Make consistent use of `is_me?`, `is_my_own?`, etc. since these are
more robust and don't use the `user` accessor method (soon to be
deprecated) directly.
2. Add missing test coverage for `BookmarkGuardian` methods.
2025-08-14 15:23:42 +08:00

15 lines
301 B
Ruby

# frozen_string_literal: true
module BookmarkGuardian
def can_delete_bookmark?(bookmark)
is_my_own?(bookmark)
end
def can_edit_bookmark?(bookmark)
is_my_own?(bookmark)
end
def can_see_bookmarkable?(bookmark)
bookmark.registered_bookmarkable.can_see?(self, bookmark)
end
end