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 28 29 30 |
# File 'app/controllers/hyrax/depositors_controller.rb', line 17 def create grantor = grantee = ::User.from_url_component(params[:grantee_id]) if grantor == grantee render_json_response(response_type: :unprocessable_entity, message: view_context.t('hyrax.dashboard.proxy_add_deny')) elsif 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: sanitize_route_string(hyrax.user_depositor_path(grantor.user_key, grantee.user_key)) } end end |
#destroy ⇒ Object
32 33 34 35 36 |
# File 'app/controllers/hyrax/depositors_controller.rb', line 32 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 |