Class: UpdateMonitorController

Inherits:
ApplicationController show all
Defined in:
frontend/app/controllers/update_monitor_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#archivesspace, can_access?, permission_mappings, set_access_control

Instance Method Details

#pollObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'frontend/app/controllers/update_monitor_controller.rb', line 9

def poll
  uri = params[:uri]
  lock_version = params[:lock_version].to_i

  raise AccessDeniedException.new if !session[:user]

  if uri =~ /\/repositories\/([0-9]+)/ && session[:repo_id] != $1.to_i
    render :json => {:status => "repository_changed"}
  else
    render :json => EditMediator.record(session[:user], uri, lock_version, Time.now)
  end
end