Flockingbird/roost

View on GitHub
app/web/policies/contact_policy.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

##
# Policy for the Contact Aggregate
class ContactPolicy < ApplicationPolicy
  def add?
    !anon? && !self?
  end

  private

  def anon?
    actor.null?
  end

  def self?
    actor == aggregate
  end
end