class PrxAuth::Rails::Token

Public Class Methods

new(token_data) click to toggle source
# File lib/prx_auth/rails/token.rb, line 4
def initialize(token_data)
  @token_data = token_data
  @namespace = PrxAuth::Rails.configuration.namespace
end

Public Instance Methods

authorized?(resource, namespace=nil, scope=nil) click to toggle source
# File lib/prx_auth/rails/token.rb, line 9
def authorized?(resource, namespace=nil, scope=nil)
  namespace, scope = @namespace, namespace if scope.nil? && !namespace.nil?
  @token_data.authorized?(resource, namespace, scope)
end
authorized_account_ids(scope) click to toggle source
# File lib/prx_auth/rails/token.rb, line 32
def authorized_account_ids(scope)
  @token_data.authorized_account_ids(scope)
end
globally_authorized?(namespace, scope=nil) click to toggle source
# File lib/prx_auth/rails/token.rb, line 14
def globally_authorized?(namespace, scope=nil)
  namespace, scope = @namespace, namespace if scope.nil?
  @token_data.globally_authorized?(namespace, scope)
end
resources(namespace=nil, scope=nil) click to toggle source
# File lib/prx_auth/rails/token.rb, line 19
def resources(namespace=nil, scope=nil)
  namespace, scope = @namespace, namespace if scope.nil? && !namespace.nil?
  @token_data.resources(namespace, scope)
end
scopes() click to toggle source
# File lib/prx_auth/rails/token.rb, line 24
def scopes
  @token_data.scopes
end
user_id() click to toggle source
# File lib/prx_auth/rails/token.rb, line 28
def user_id
  @token_data.user_id
end