votes: make private favorites and upvotes a Gold-only option.
Make private favorites and upvotes a Gold-only account option. Existing Members with private favorites enabled are allowed to keep it enabled, as long as they don't disable it. If they disable it, then they can't re-enable it again without upgrading to Gold first. This is a Gold-only option to prevent uploaders from creating multiple accounts to upvote their own posts. If private upvotes were allowed for Members, then it would be too easy to use fake accounts and private upvotes to upvote your own posts.
This commit is contained in:
@@ -31,6 +31,10 @@ class UserPolicy < ApplicationPolicy
|
||||
user.is_admin? || record.id == user.id || !record.enable_private_favorites?
|
||||
end
|
||||
|
||||
def can_enable_private_favorites?
|
||||
user.is_gold?
|
||||
end
|
||||
|
||||
def permitted_attributes_for_create
|
||||
[:name, :password, :password_confirmation, { email_address_attributes: [:address] }]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user