add testing environment

This commit is contained in:
Pete Matsyburka committed 2024-01-21 11:20:34 +02:00
1 parent 3dcb7c813f
commit 6253e80a70
23 files changed
+246 -17

No files matched your search

@@ -0,0 +1,20 @@
# frozen_string_literal: true
class TestingAccountsController < ApplicationController
skip_authorization_check only: :destroy
def show
authorize!(:manage, current_account)
authorize!(:manage, current_user)
impersonate_user(Accounts.find_or_create_testing_user(current_account))
redirect_back(fallback_location: root_path)
end
def destroy
stop_impersonating_user
redirect_back(fallback_location: root_path)
end
end