Class: CmisServer::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/cmis_server/application_controller.rb

Direct Known Subclasses

CmisServer::AtomPub::BaseController

Instance Method Summary collapse

Instance Method Details

#check_authObject



12
13
14
15
16
17
# File 'app/controllers/cmis_server/application_controller.rb', line 12

def check_auth
  #ToDo Proc to be provided in gem config by the final application

  #auth_proc= Proc.new {|username,password|  (resource=User.find_by(login: username))&&resource.valid_password?(password)&&(context.current_user=resource)}
  context[:current_user] = authenticate_or_request_with_http_basic &CmisServer.configuration.http_basic_auth_procedure
end

#contextObject



8
9
10
# File 'app/controllers/cmis_server/application_controller.rb', line 8

def context
  @context ||= Hash.new
end