method

resolve_source

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: PermissionsPolicy
resolve_source(source, context) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_dispatch/http/permissions_policy.rb, line 194
      def resolve_source(source, context)
        case source
        when String
          source
        when Symbol
          source.to_s
        when Proc
          if context.nil?
            raise RuntimeError, "Missing context for the dynamic permissions policy source: #{source.inspect}"
          else
            context.instance_exec(&source)
          end
        else
          raise RuntimeError, "Unexpected permissions policy source: #{source.inspect}"
        end
      end
Register or log in to add new notes.