Configures the HTTP Feature-Policy response header to specify which browser features the current document and its iframes can use.

Example global policy:

Rails.application.config.permissions_policy do |policy|
  policy.camera      :none
  policy.gyroscope   :none
  policy.microphone  :none
  policy.usb         :none
  policy.fullscreen  :self
  policy.payment     :self, "https://secure.example.com"
end

Namespace

Module

Class

Methods

Attributes

[R] directives

Class Public methods

new()

📝 Source code
# File actionpack/lib/action_dispatch/http/permissions_policy.rb, line 113
    def initialize
      @directives = {}
      yield self if block_given?
    end
🔎 See on GitHub

Instance Public methods

build(context = nil)

📝 Source code
# File actionpack/lib/action_dispatch/http/permissions_policy.rb, line 132
    def build(context = nil)
      build_directives(context).compact.join("; ")
    end
🔎 See on GitHub

initialize_copy(other)

📝 Source code
# File actionpack/lib/action_dispatch/http/permissions_policy.rb, line 118
    def initialize_copy(other)
      @directives = other.directives.deep_dup
    end
🔎 See on GitHub