retrospring/app/policies/anonymous_block_policy.rb
2022-11-21 22:29:47 +01:00

18 lines
313 B
Ruby

# frozen_string_literal: true
class AnonymousBlockPolicy
attr_reader :user, :anonymous_block
def initialize(user, anonymous_block)
@user = user
@anonymous_block = anonymous_block
end
def create_global?
user.mod?
end
def destroy?
user == anonymous_block.user || user.mod?
end
end