Class: V0::TermsOfUseAgreementsController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- V0::TermsOfUseAgreementsController
- Defined in:
- app/controllers/v0/terms_of_use_agreements_controller.rb
Constant Summary
Constants inherited from ApplicationController
ApplicationController::VERSION_STATUS
Constants included from SignIn::Authentication
SignIn::Authentication::BEARER_PATTERN
Constants included from ExceptionHandling
ExceptionHandling::SKIP_SENTRY_EXCEPTION_TYPES
Instance Method Summary collapse
Methods inherited from ApplicationController
#clear_saved_form, #cors_preflight, #routing_error
Methods included from Traceable
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger
Methods included from SignIn::Authentication
#authenticate, #authenticate_service_account, #load_user
Methods included from Headers
#block_unknown_hosts, #set_app_info_headers
Methods included from AuthenticationAndSSOConcerns
#authenticate, #clear_session, #extend_session!, #load_user, #log_sso_info, #render_unauthorized, #reset_session, #set_api_cookie!, #set_session_expiration_header, #sso_logging_info, #validate_inbound_login_params, #validate_session
Instance Method Details
#accept ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/v0/terms_of_use_agreements_controller.rb', line 18 def accept terms_of_use_agreement = TermsOfUse::Acceptor.new(user_account: current_user.user_account, common_name: current_user.common_name, version: params[:version]).perform! recache_user render_success(terms_of_use_agreement, :created) rescue TermsOfUse::Errors::AcceptorError => e render_error(e.) end |
#decline ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/v0/terms_of_use_agreements_controller.rb', line 28 def decline terms_of_use_agreement = TermsOfUse::Decliner.new(user_account: current_user.user_account, common_name: current_user.common_name, version: params[:version]).perform! recache_user render_success(terms_of_use_agreement, :created) rescue TermsOfUse::Errors::DeclinerError => e render_error(e.) end |
#latest ⇒ Object
13 14 15 16 |
# File 'app/controllers/v0/terms_of_use_agreements_controller.rb', line 13 def latest terms_of_use_agreement = get_terms_of_use_agreements_for_version(params[:version]).last render_success(terms_of_use_agreement, :ok) end |
#update_provisioning ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'app/controllers/v0/terms_of_use_agreements_controller.rb', line 38 def update_provisioning provisioner = TermsOfUse::Provisioner.new(icn: current_user.icn, first_name: current_user.first_name, last_name: current_user.last_name, mpi_gcids: current_user.mpi_gcids) if provisioner.perform render json: { provisioned: true }, status: :ok else render_error('Failed to provision') end rescue TermsOfUse::Errors::ProvisionerError => e render_error(e.) end |