Sha256: 2427687aa91dfd66880b5ef4150282cb4048eda325f7e3bf9d9ff0ccee403ecc

Contents?: true

Size: 778 Bytes

Versions: 6

Compression:

Stored size: 778 Bytes

Contents

# This copies the permissions of The Logs controller

module Admin
  class TrashController < ApplicationController
    before_action :authenticate_user!

    layout (EffectiveTrash.layout.kind_of?(Hash) ? EffectiveTrash.layout[:admin_trash] : EffectiveTrash.layout)

    def index
      @datatable = EffectiveTrashDatatable.new(self)

      @page_title = 'Trash'

      EffectiveResources.authorize!(self, :index, Effective::Trash)
      EffectiveResources.authorize!(self, :admin, :effective_trash)
    end

    def show
      @trash = Effective::Trash.all.find(params[:id])
      @page_title = "Trash item - #{@trash.trashed_to_s}"

      EffectiveResources.authorize!(self, :show, @trash)
      EffectiveResources.authorize!(self, :admin, :effective_trash)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
effective_trash-0.4.5 app/controllers/admin/trash_controller.rb
effective_trash-0.4.4 app/controllers/admin/trash_controller.rb
effective_trash-0.4.3 app/controllers/admin/trash_controller.rb
effective_trash-0.4.2 app/controllers/admin/trash_controller.rb
effective_trash-0.4.1 app/controllers/admin/trash_controller.rb
effective_trash-0.4.0 app/controllers/admin/trash_controller.rb