retrospring/app/policies/mute_rule_policy.rb
2022-11-21 20:26:19 +01:00

14 lines
237 B
Ruby

# frozen_string_literal: true
class MuteRulePolicy
attr_reader :user, :mute_rule
def initialize(user, mute_rule)
@user = user
@mute_rule = mute_rule
end
def destroy?
user == mute_rule.user || user.admin?
end
end