Files
danbooru/app/policies/forum_post_vote_policy.rb
2020-03-20 18:03:01 -05:00

14 lines
237 B
Ruby

class ForumPostVotePolicy < ApplicationPolicy
def create?
unbanned? && policy(record.forum_post).votable?
end
def destroy?
unbanned? && record.creator_id == user.id
end
def permitted_attributes
[:score]
end
end