Retrospring/app/policies/anonymous_block_policy.rb

19 lines
313 B
Ruby
Raw Normal View History

2022-11-21 13:29:47 -08:00
# 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