Class: SharingEngineController

Inherits:
ApplicationController
  • Object
show all
Includes:
SharingPluginHelper
Defined in:
app/controllers/sharing_engine_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

#configureObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/sharing_engine_controller.rb', line 15

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

  if request.xhr?
    respond_to do |t|
      t.html
    end
  else
    raise 'unauthorized access'
  end
end

#indexObject



11
12
13
# File 'app/controllers/sharing_engine_controller.rb', line 11

def index

end

#installerObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'app/controllers/sharing_engine_controller.rb', line 33

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

  if request.xhr?
    respond_to do |t|
      t.html
    end
  else
    raise 'unauthorized access'
  end
end