mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 18:29:52 +01:00
18 lines
313 B
Ruby
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
|