Class: SharingInstallerController

Inherits:
ApplicationController
  • Object
show all
Includes:
SharingPluginHelper
Defined in:
app/controllers/sharing_installer_controller.rb

Constant Summary collapse

APP_CONFIG =

Load configuration items (MANDATORY, must be included)

HashWithIndifferentAccess.new(YAML.load(File.read(File.expand_path('../../../config/sharing/sharing_config.yml', __FILE__))))

Instance Method Summary collapse

Methods included from SharingPluginHelper

#current_user, #get_current_user_role

Instance Method Details

#before_processObject



11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/sharing_installer_controller.rb', line 11

def before_process
  # Check access
  if (@curUserRole == 'contentadmin' ||
      @curUserRole == 'user' ||
      @curUserRole == 'loggedin' ||
      @curUserRole == 'anonymous')
    raise 'unauthorized access'
  end

  render :json => { :status => 'unimplemented' }
end

#core_processObject



23
24
25
# File 'app/controllers/sharing_installer_controller.rb', line 23

def core_process
  render :json => { :status => 'unimplemented' }
end

#post_processObject



27
28
29
# File 'app/controllers/sharing_installer_controller.rb', line 27

def post_process
  render :json => { :status => 'unimplemented' }
end

#uninstallObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'app/controllers/sharing_installer_controller.rb', line 31

def uninstall
  begin
    # Check access
    if (@curUserRole == 'contentadmin' ||
        @curUserRole == 'user' ||
        @curUserRole == 'loggedin' ||
        @curUserRole == 'anonymous')
      raise 'unauthorized access'
    end

    render :json => { :status => 'success' }
  rescue
    render :json => { :status => 'failure' }
  end
end