lib/authz/controllers/authorization_manager.rb
# Returns true if the user has permission for the path
# and :using instance given as arguments
#
# @param path [String] path or url that will be checked
# @param method [Symbol, String] of the path or url
# @param using [Object] instance that will be used to determine authorization
# @param skip_scoping [Boolean] option to skip scoping validation
# @return [Boolean]
# @api public
# @!visibility public
Returns true if the user has permission for the path
and :using instance given as arguments
Returns true if the user has permission for the path and : using instance given as arguments
def authorized_path?(path, method: :get, using: nil, skip_scoping: false)
        recognized_ca = Rails.application.routes.recognize_path path,
                                                                method: method
        controller_name = recognized_ca[:controller]
        action_name = recognized_ca[:action]
        authorized?(controller: controller_name,
                    action: action_name,
                    using: using,
                    skip_scoping: skip_scoping)
      end
def authorized_path? ( path , method : :get , using : nil , skip_scoping : false ) recognized_ca = Rails . application . routes . recognize_path path , method : method controller_name = recognized_ca [ :controller ] action_name = recognized_ca [ :action ] authorized? ( controller : controller_name , action : action_name , using : using , skip_scoping : skip_scoping ) end
Returns true if the user has permission for the path
and :using instance given as arguments
Returns true if the user has permission for the path and : using instance given as arguments
None
Boolean
path
path or url that will be checked
path or url that will be checked
method
of the path or url
of the path or url
using
instance that will be used to determine authorization
instance that will be used to determine authorization
skip_scoping
option to skip scoping validation
option to skip scoping validation
api
None
!visibility
None