Class: Underworld::API::Base
- Inherits:
-
Grape::API
- Object
- Grape::API
- Underworld::API::Base
- Defined in:
- lib/underworld/api.rb
Overview
autoload UsersAPI, “underworld/api/users_api” autoload GroupsAPI, “underworld/api/groups_api” autoload PermissionsAPI, “underworld/api/permissions_api”
Class Method Summary collapse
Class Method Details
.setup_api ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/underworld/api.rb', line 10 def self.setup_api # TODO: Allow user to configure this section version 'v1', :vendor => "Codamic" format :json default_format :json # TODO: Give this class a logger helpers do def warden env['warden'] end def current_user warden.user end def authenticated_user if warden.authenticated? return true else error!('401 Unauthorized', 401) end end end end |