Class: OpenStax::Api::V1::ApiController

Inherits:
ActionController::Base
  • Object
show all
Includes:
Apipie, Roar, Roar::Rails::ControllerAdditions
Defined in:
app/controllers/openstax/api/v1/api_controller.rb

Instance Method Summary collapse

Methods included from Apipie

included

Methods included from Roar

#render_api_errors, #standard_create, #standard_destroy, #standard_index, #standard_nested_create, #standard_read, #standard_restore, #standard_search, #standard_sort, #standard_update

Instance Method Details

#authenticate_user!Object

intended to be overridden by parent



44
45
46
# File 'app/controllers/openstax/api/v1/api_controller.rb', line 44

def authenticate_user!
  throw(:abort)
end

#current_api_userObject

Always return an ApiUser



49
50
51
# File 'app/controllers/openstax/api/v1/api_controller.rb', line 49

def current_api_user
  @current_api_user ||= ApiUser.new(doorkeeper_token, lambda { current_session_user })
end

#current_applicationObject



53
54
55
# File 'app/controllers/openstax/api/v1/api_controller.rb', line 53

def current_application
  current_api_user.application
end

#current_human_userObject



57
58
59
# File 'app/controllers/openstax/api/v1/api_controller.rb', line 57

def current_human_user
  current_api_user.human_user
end

#optionsObject



61
62
63
# File 'app/controllers/openstax/api/v1/api_controller.rb', line 61

def options
  head :ok
end