Class: Authz::ControllerActionsController Private

Inherits:
ApplicationController show all
Defined in:
app/controllers/authz/controller_actions_controller.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods included from Authz::Controllers::AuthorizationManager

#apply_authz_scopes, #authorize, #authorized?, #authorized_path?, #skip_authorization, #verify_authorized

Instance Method Details

#createObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/authz/controller_actions_controller.rb', line 20

def create
  @controller_action = ControllerAction.new(controller_action_create_params)
  if @controller_action.save
    flash[:success] = "#{@controller_action.to_s} created successfully"
    redirect_to controller_action_path(@controller_action)
  else
    flash.now[:error] = "There was an issue creating this controller action"
    render 'new'
  end
end

#destroyObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



46
47
48
49
50
51
52
53
54
55
# File 'app/controllers/authz/controller_actions_controller.rb', line 46

def destroy
  @controller_action = ControllerAction.find(params[:id])
  if @controller_action.destroy
    flash[:success] = "#{@controller_action.to_s} destroyed successfully"
    redirect_to controller_actions_path
  else
    flash.now[:error] = "There was an issue destroying #{@controller_action.to_s}"
    render 'show'
  end
end

#editObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



31
32
33
# File 'app/controllers/authz/controller_actions_controller.rb', line 31

def edit
  @controller_action = ControllerAction.find(params[:id])
end

#indexObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



6
7
8
# File 'app/controllers/authz/controller_actions_controller.rb', line 6

def index
  @controller_actions = ControllerAction.all.order(created_at: :desc).page(params[:controller_actions_page])
end

#newObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
# File 'app/controllers/authz/controller_actions_controller.rb', line 16

def new
  @controller_action = ControllerAction.new
end

#showObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
13
14
# File 'app/controllers/authz/controller_actions_controller.rb', line 10

def show
  @controller_action = ControllerAction.find(params[:id])
  @associated_business_processes = @controller_action.business_processes.distinct.page(params[:business_processes_page]).per(10)
  @associated_roles = @controller_action.roles.distinct.page(params[:roles_page]).per(10)
end

#updateObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



35
36
37
38
39
40
41
42
43
44
# File 'app/controllers/authz/controller_actions_controller.rb', line 35

def update
  @controller_action = ControllerAction.find(params[:id])
  if @controller_action.update(controller_action_update_params)
    flash[:success] = "#{@controller_action.to_s} updated successfully"
    redirect_to controller_action_path(@controller_action)
  else
    flash.now[:error] = "There was an issue updating #{@controller_action.to_s}"
    render 'edit'
  end
end