Class: AnoubisSsoServer::IndexController

Inherits:
ApplicationController show all
Defined in:
app/controllers/anoubis_sso_server/index_controller.rb

Overview

Index controller class. Output system actions

Instance Attribute Summary

Attributes inherited from ApplicationController

#current_system, #current_user, #etc, #sso_login_url, #sso_origin, #sso_server, #sso_silent_url, #user_model

Instance Method Summary collapse

Methods inherited from ApplicationController

#access_allowed?, #after_anoubis_initialization, #after_sso_server_initialization, #authentication, #check_listed_parameters, #check_origin, #get_current_system, #get_oauth_session, #get_user_by_uuid, #render_error_exit

Instance Method Details

#authenticate?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'app/controllers/anoubis_sso_server/index_controller.rb', line 47

def authenticate?
  true
end

#dashboardObject

Default dashboard action



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/anoubis_sso_server/index_controller.rb', line 7

def dashboard
  result = {
    result: 0,
    message: I18n.t('anoubis.success'),
    data: {
      name: current_user.name,
      surname: current_user.surname,
      email: current_user.email,
      id: current_user.public
    }
  }

  render json: result
end

Output allowed menu items



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'app/controllers/anoubis_sso_server/index_controller.rb', line 24

def menu
  result = {
    result: 0,
    message: I18n.t('anoubis.success'),
    menu: [
      {
        mode: 'dashboard',
        title: I18n.t('anoubis.install.menu.dashboard.title'),
        page_title: I18n.t('anoubis.install.menu.dashboard.page_title'),
        short_title: I18n.t('anoubis.install.menu.dashboard.short_title'),
        position: 0,
        tab: 0,
        action: 'data',
        access: 'write',
        state: 'show',
        parent: nil
      }
    ]
  }

  render json: result
end