mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-04 06:28:47 +08:00
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.
15 lines
301 B
Ruby
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
|