module Roda::RodaPlugins::PermissionsPolicy::ResponseMethods

def initialize

Unset any permissions policy when reinitializing
def initialize
  super
  @permissions_policy &&= nil
end

def permissions_policy

The current permissions policy to be used for this response.
def permissions_policy
  @permissions_policy ||= roda_class.opts[:permissions_policy].dup
end

def set_default_headers

Set the appropriate permissions policy header.
def set_default_headers
  super
  unless @skip_permissions_policy
    (@permissions_policy || roda_class.opts[:permissions_policy]).set_header(headers)
  end
end

def skip_permissions_policy!

Do not set a permissions policy header for this response.
def skip_permissions_policy!
  @skip_permissions_policy = true
end