pundit: convert post votes to pundit.
Side effects:
* The data-current-user-is-voter <body> attribute has been removed.
* {{upvote:self}} no longer works. {{upvote:<name>}} should be used instead.
This commit is contained in:
9
app/policies/post_vote_policy.rb
Normal file
9
app/policies/post_vote_policy.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class PostVotePolicy < ApplicationPolicy
|
||||
def create?
|
||||
unbanned? && user.is_gold?
|
||||
end
|
||||
|
||||
def destroy?
|
||||
unbanned? && user.is_gold?
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user