Class: Angarium::Api::BaseController
- Inherits:
-
Object
- Object
- Angarium::Api::BaseController
- Defined in:
- app/controllers/angarium/api/base_controller.rb
Overview
Base controller for the headless JSON API. Inherits from your app's controller (config.parent_controller, default "ApplicationController"), so your existing authentication applies here too.
Direct Known Subclasses
AttemptsController, DeliveriesController, EndpointsController
Instance Method Summary collapse
-
#angarium_current_user ⇒ Object
Resolved current user (via config.current_user).
Instance Method Details
#angarium_current_user ⇒ Object
Resolved current user (via config.current_user). Public so policies can
read it as controller.angarium_current_user.
21 22 23 24 25 |
# File 'app/controllers/angarium/api/base_controller.rb', line 21 def angarium_current_user return @angarium_current_user if defined?(@angarium_current_user) @angarium_current_user = Angarium.config.current_user.call(self) end |