Remove access checks when watching
https://github.com/basecamp/fizzy/pull/425#discussion_r2056039581
This commit is contained in:
@@ -13,9 +13,7 @@ module Card::Watchable
|
||||
end
|
||||
|
||||
def watch_by(user)
|
||||
if collection.accessible_to?(user)
|
||||
watches.where(user: user).first_or_create.update!(watching: true)
|
||||
end
|
||||
watches.where(user: user).first_or_create.update!(watching: true)
|
||||
end
|
||||
|
||||
def unwatch_by(user)
|
||||
|
||||
@@ -32,10 +32,6 @@ module Collection::Accessible
|
||||
accesses.find_by(user: user)
|
||||
end
|
||||
|
||||
def accessible_to?(user)
|
||||
access_for(user).present?
|
||||
end
|
||||
|
||||
private
|
||||
def grant_access_to_everyone
|
||||
accesses.grant_to(User.all) if all_access_previously_changed?(to: true)
|
||||
|
||||
@@ -9,10 +9,6 @@ module User::Accessor
|
||||
after_create_commit :grant_access_to_collections
|
||||
end
|
||||
|
||||
def can_access_card?(card)
|
||||
card.collection.accessible_to?(self)
|
||||
end
|
||||
|
||||
private
|
||||
def grant_access_to_collections
|
||||
Access.insert_all Collection.all_access.pluck(:id).collect { |collection_id| { collection_id: collection_id, user_id: id } }
|
||||
|
||||
Reference in New Issue
Block a user