Files
danbooru/app/policies/forum_post_vote_policy.rb
evazion a7dc05ce63 Enable frozen string literals.
Make all string literals immutable by default.
2021-12-14 21:33:27 -06:00

16 lines
268 B
Ruby

# frozen_string_literal: true
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