Class: Incline::SecurityController

Inherits:
ApplicationController show all
Defined in:
app/controllers/incline/security_controller.rb

Instance Method Summary collapse

Instance Method Details

#apiObject

GET/POST /incline/security/api?action=…



51
52
53
# File 'app/controllers/incline/security_controller.rb', line 51

def api
  process_api_action
end

#editObject

GET /incline/security/1/edit



32
33
# File 'app/controllers/incline/security_controller.rb', line 32

def edit
end

#indexObject

GET /incline/security



13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/incline/security_controller.rb', line 13

def index
  @lists = {}
  unless @dt_request.provided?
    Incline::ActionSecurity.valid_items   # ensure only valid items are in the database.

    # build lists for the dropdown filters.
    @lists[:controller_name] = Incline::ActionSecurity.visible.pluck(:controller_name).uniq.sort
    @lists[:action_name] = Incline::ActionSecurity.visible.pluck(:action_name).uniq.sort
    @lists[:short_permitted] = Incline::ActionSecurity::SHORT_PERMITTED_FILTERS
  end
end

#locateObject

POST /incline/security/1/locate



46
47
48
# File 'app/controllers/incline/security_controller.rb', line 46

def locate
  render json: { record: @dt_request.record_location }
end

#showObject

GET /incline/security/1



27
28
# File 'app/controllers/incline/security_controller.rb', line 27

def show
end

#updateObject

PATCH/PUT /incline/security/1



37
38
39
40
41
42
43
# File 'app/controllers/incline/security_controller.rb', line 37

def update
  if @security.update(security_params)
    handle_update_success notice: 'Action security was successfully updated.'
  else
    handle_update_failure :edit
  end
end