Class: RbacRls::PermissionsController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /permissions



24
25
26
27
28
29
30
31
32
33
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 24

def create
  @permission = Permission.new(permission_params)

  if @permission.save

    redirect_to @permission, notice: "Permission was successfully created."
  else
    render :new, status: :unprocessable_entity
  end
end

#destroyObject

DELETE /permissions/1



45
46
47
48
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 45

def destroy
  @permission.destroy
  redirect_to permissions_url, notice: "Permission was successfully destroyed."
end

#editObject

GET /permissions/1/edit



20
21
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 20

def edit
end

#indexObject

GET /permissions



6
7
8
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 6

def index
  @permissions = Permission.all
end

#newObject

GET /permissions/new



15
16
17
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 15

def new
  @permission = Permission.new
end

#showObject

GET /permissions/1



11
12
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 11

def show
end

#updateObject

PATCH/PUT /permissions/1



36
37
38
39
40
41
42
# File 'app/controllers/rbac_rls/permissions_controller.rb', line 36

def update
  if @permission.update(permission_params)
    redirect_to @permission, notice: "Permission was successfully updated."
  else
    render :edit, status: :unprocessable_entity
  end
end