Class: Hyrax::TransfersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Hyrax::TransfersController
- Defined in:
- app/controllers/hyrax/transfers_controller.rb
Instance Method Summary collapse
-
#accept ⇒ Object
Kicks of a job that completes the transfer.
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #reject ⇒ Object
Instance Method Details
#accept ⇒ Object
Kicks of a job that completes the transfer. If params is set, it will revoke any existing edit permissions on the work.
46 47 48 49 50 51 52 53 |
# File 'app/controllers/hyrax/transfers_controller.rb', line 46 def accept @proxy_deposit_request.transfer!(params[:reset]) if params[:sticky] current_user.can_receive_deposits_from << @proxy_deposit_request.sending_user unless current_user.can_receive_deposits_from.include? @proxy_deposit_request.sending_user end redirect_to hyrax.transfers_path, notice: "Transfer complete" end |
#create ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'app/controllers/hyrax/transfers_controller.rb', line 28 def create @proxy_deposit_request.sending_user = current_user if @proxy_deposit_request.save redirect_to hyrax.transfers_path, notice: "Transfer request created" else render :new end end |
#destroy ⇒ Object
60 61 62 63 |
# File 'app/controllers/hyrax/transfers_controller.rb', line 60 def destroy @proxy_deposit_request.cancel! redirect_to hyrax.transfers_path, notice: "Transfer canceled" end |
#index ⇒ Object
37 38 39 40 41 42 |
# File 'app/controllers/hyrax/transfers_controller.rb', line 37 def index t(:'hyrax.controls.home'), root_path t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path t(:'hyrax.admin.sidebar.transfers'), hyrax.transfers_path @presenter = TransfersPresenter.new(current_user, view_context) end |
#new ⇒ Object
22 23 24 25 26 |
# File 'app/controllers/hyrax/transfers_controller.rb', line 22 def new t(:'hyrax.controls.home'), root_path t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path t(:'hyrax.transfers.new.header'), hyrax.new_work_transfer_path end |
#reject ⇒ Object
55 56 57 58 |
# File 'app/controllers/hyrax/transfers_controller.rb', line 55 def reject @proxy_deposit_request.reject! redirect_to hyrax.transfers_path, notice: "Transfer rejected" end |