Sha256: af3d2f868828d991496adc982a6ef3818ff7f9413637cf7a6156686202e449e2

Contents?: true

Size: 762 Bytes

Versions: 4

Compression:

Stored size: 762 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'

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

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
effective_trash-0.3.3 app/controllers/admin/trash_controller.rb
effective_trash-0.3.2 app/controllers/admin/trash_controller.rb
effective_trash-0.3.1 app/controllers/admin/trash_controller.rb
effective_trash-0.3.0 app/controllers/admin/trash_controller.rb