module Underworld module API #autoload UsersAPI, "underworld/api/users_api" #autoload GroupsAPI, "underworld/api/groups_api" #autoload PermissionsAPI, "underworld/api/permissions_api" class Base < Grape::API 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 end end end