Files

21 lines
458 B
Ruby
Raw Permalink Normal View History

2024-01-20 23:53:14 +02:00
# frozen_string_literal: true
class TestingAccountsController < ApplicationController
skip_authorization_check only: :destroy
2026-04-27 12:13:53 +03:00
def create
2024-01-20 23:53:14 +02:00
authorize!(:manage, current_account)
authorize!(:manage, current_user)
impersonate_user(Accounts.find_or_create_testing_user(true_user.account))
2024-01-20 23:53:14 +02:00
redirect_back(fallback_location: root_path)
end
def destroy
stop_impersonating_user
redirect_back(fallback_location: root_path)
end
end