Class: Hyrax::DepositorsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Hyrax::DepositorsController
- Includes:
- DenyAccessOverrideBehavior
- Defined in:
- app/controllers/hyrax/depositors_controller.rb
Instance Method Summary collapse
Methods included from DenyAccessOverrideBehavior
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/hyrax/depositors_controller.rb', line 17 def create grantor = grantee = ::User.from_url_component(params[:grantee_id]) if grantor.can_receive_deposits_from.include?(grantee) head :ok else grantor.can_receive_deposits_from << grantee (grantor, grantee) render json: { name: grantee.name, delete_path: hyrax.user_depositor_path(grantor.user_key, grantee.user_key) } end end |
#destroy ⇒ Object
29 30 31 32 33 |
# File 'app/controllers/hyrax/depositors_controller.rb', line 29 def destroy grantor = grantor.can_receive_deposits_from.delete(::User.from_url_component(params[:id])) head :ok end |
#index ⇒ Object
10 11 12 13 14 15 |
# File 'app/controllers/hyrax/depositors_controller.rb', line 10 def index t(:'hyrax.controls.home'), root_path t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path t(:'hyrax.dashboard.manage_proxies'), hyrax.depositors_path @user = current_user end |
#validate_users ⇒ Object
35 36 37 |
# File 'app/controllers/hyrax/depositors_controller.rb', line 35 def validate_users head :ok if params[:user_id] == params[:grantee_id] end |