Class: AccessGroupsController

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

Overview

This is the controller that allows managing the access groups used for authorizing access to resources.

Instance Method Summary collapse

Methods inherited from BarkestCore::ApplicationControllerBase

#authorize!, #show_denial_reason?

Methods included from BarkestCore::StatusHelper

#clear_system_status, #show_system_status, #status_button_label, #status_redirect_url

Methods included from BarkestCore::RecaptchaHelper

#add_recaptcha_challenge, #verify_recaptcha_challenge

Methods included from BarkestCore::SessionsHelper

#current_user, #current_user?, #forget, #log_in, #log_out, #logged_in?, #redirect_back_or, #remember, #store_location, #store_location_and_redirect_to, #system_admin?

Instance Method Details

#createObject

POST /access_groups



32
33
34
35
36
37
38
39
40
# File 'app/controllers/access_groups_controller.rb', line 32

def create
  @access_group = AccessGroup.new(access_group_params)

  if @access_group.save
    redirect_to access_groups_url, notice: 'Access group was successfully created.'
  else
    render :new
  end
end

#destroyObject

DELETE /access_groups/1



54
55
56
57
# File 'app/controllers/access_groups_controller.rb', line 54

def destroy
  @access_group.destroy
  redirect_to access_groups_url, notice: 'Access group was successfully destroyed.'
end

#editObject

GET /access_groups/1/edit



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

def edit
end

#indexObject

GET /access_groups



10
11
12
# File 'app/controllers/access_groups_controller.rb', line 10

def index
  @access_groups = AccessGroup.all.sorted
end

#newObject

GET /access_groups/new



21
22
23
# File 'app/controllers/access_groups_controller.rb', line 21

def new
  @access_group = AccessGroup.new
end

#showObject

GET /access_groups/1



16
17
# File 'app/controllers/access_groups_controller.rb', line 16

def show
end

#updateObject

PATCH/PUT /access_groups/1



44
45
46
47
48
49
50
# File 'app/controllers/access_groups_controller.rb', line 44

def update
  if @access_group.update(access_group_params)
    redirect_to access_groups_url, notice: 'Access group was successfully updated.'
  else
    render :edit
  end
end