# typed: strict
class Domain::PostPolicy < ApplicationPolicy
  extend T::Sig

  sig { returns(T::Boolean) }
  def show?
    true
  end

  sig { returns(T::Boolean) }
  def index?
    true
  end

  sig { returns(T::Boolean) }
  def visual_search?
    # is_role_at_least_user?
    true
  end

  sig { returns(T::Boolean) }
  def visual_results?
    # is_role_at_least_user?
    true
  end

  sig { returns(T::Boolean) }
  def view_file?
    is_role_at_least_user?
  end

  sig { returns(T::Boolean) }
  def view_scan_metadata?
    is_role_admin?
  end

  sig { returns(T::Boolean) }
  def users_faving_post?
    is_role_at_least_user?
  end

  sig { returns(T::Boolean) }
  def view_faved_by?
    is_role_at_least_user?
  end

  sig { returns(T::Boolean) }
  def user_favorite_posts?
    true
  end

  sig { returns(T::Boolean) }
  def user_created_posts?
    true
  end

  class Scope < ApplicationPolicy::Scope
    extend T::Sig
    sig { returns(ActiveRecord::Relation) }
    def resolve
      scope.all
    end
  end
end
