Class: ActionDispatch::PermissionsPolicy
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Classes:
| |
Inherits: | Object |
Defined in: | actionpack/lib/action_dispatch/http/permissions_policy.rb |
Constant Summary
-
DIRECTIVES =
private
List of available permissions can be found at github.com/w3c/webappsec-permissions-policy/blob/master/features.md#policy-controlled-features
{ accelerometer: "accelerometer", ambient_light_sensor: "ambient-light-sensor", autoplay: "autoplay", camera: "camera", encrypted_media: "encrypted-media", fullscreen: "fullscreen", geolocation: "geolocation", gyroscope: "gyroscope", magnetometer: "magnetometer", microphone: "microphone", midi: "midi", payment: "payment", picture_in_picture: "picture-in-picture", speaker: "speaker", usb: "usb", vibrate: "vibrate", vr: "vr", }.freeze
-
MAPPINGS =
private
# File 'actionpack/lib/action_dispatch/http/permissions_policy.rb', line 59{ self: "'self'", none: "'none'", }.freeze
Class Method Summary
- .new {|_self| ... } ⇒ PermissionsPolicy constructor
Instance Attribute Summary
- #directives readonly
Instance Method Summary
Constructor Details
.new {|_self| ... } ⇒ PermissionsPolicy
# File 'actionpack/lib/action_dispatch/http/permissions_policy.rb', line 90
def initialize @directives = {} yield self if block_given? end
Instance Attribute Details
#directives (readonly)
[ GitHub ]# File 'actionpack/lib/action_dispatch/http/permissions_policy.rb', line 88
attr_reader :directives
Instance Method Details
#build(context = nil)
[ GitHub ]# File 'actionpack/lib/action_dispatch/http/permissions_policy.rb', line 109
def build(context = nil) build_directives(context).compact.join("; ") end
#initialize_copy(other)
[ GitHub ]# File 'actionpack/lib/action_dispatch/http/permissions_policy.rb', line 95
def initialize_copy(other) @directives = other.directives.deep_dup end