Class: OpenStax::Api::V1::ApiController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- OpenStax::Api::V1::ApiController
- Defined in:
- app/controllers/openstax/api/v1/api_controller.rb
Instance Method Summary collapse
-
#authenticate_user! ⇒ Object
intended to be overridden by parent.
-
#current_api_user ⇒ Object
Always return an ApiUser.
- #current_application ⇒ Object
- #current_human_user ⇒ Object
- #options ⇒ Object
Methods included from Apipie
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_user ⇒ Object
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_application ⇒ Object
53 54 55 |
# File 'app/controllers/openstax/api/v1/api_controller.rb', line 53 def current_application current_api_user.application end |
#current_human_user ⇒ Object
57 58 59 |
# File 'app/controllers/openstax/api/v1/api_controller.rb', line 57 def current_human_user current_api_user.human_user end |
#options ⇒ Object
61 62 63 |
# File 'app/controllers/openstax/api/v1/api_controller.rb', line 61 def head :ok end |