Method: Rack::PrxAuth::TokenData#authorized?

Defined in:
lib/rack/prx_auth/token_data.rb

#authorized?(resource, scope = nil) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
32
33
34
# File 'lib/rack/prx_auth/token_data.rb', line 26

def authorized?(resource, scope=nil)
  if resource == WILDCARD_RESOURCE_NAME
    globally_authorized?(scope)
  elsif scope.nil?
    authorized_for_resource?(resource, scope)
  else
    authorized_for_resource?(resource, scope) || globally_authorized?(scope)
  end
end