Class: Authz::RolablesController Private

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

Overview

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.

Handles the controller actions related to the rolables

Instance Method Summary collapse

Methods included from Controllers::AuthorizationManager

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

Instance Method Details

#edit ⇒ Object

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.



18
19
20
# File 'app/controllers/authz/rolables_controller.rb', line 18

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

#index ⇒ Object

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.



7
8
9
# File 'app/controllers/authz/rolables_controller.rb', line 7

def index
  @rolables = rolable.all.page(params[:page])
end

#show ⇒ Object

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.



11
12
13
14
15
16
# File 'app/controllers/authz/rolables_controller.rb', line 11

def show
  @rolable = rolable.find(params[:id])
  @associated_roles = @rolable.roles.page(1)
  @associated_business_processes = @rolable.business_processes.page(params[:business_processes_page])
  @associated_controller_actions = @rolable.controller_actions.page(params[:controller_actions_page])
end

#update ⇒ Object

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.



22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/authz/rolables_controller.rb', line 22

def update
  @rolable = rolable.find(params[:id])
  if @rolable.update(rolable_params)
    flash[:success] = "#{@rolable.authz_label} updated successfully"
    redirect_to send("#{@rolable.model_name.singular}_path", @rolable)
  else
    flash.now[:error] = "There was an issue updating #{@rolable.authz_label}"
    render 'edit'
  end
end