mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
22 lines
499 B
Ruby
22 lines
499 B
Ruby
# frozen_string_literal: true
|
|
|
|
class TestingAccountsController < ApplicationController
|
|
skip_authorization_check only: :destroy
|
|
|
|
def create
|
|
authorize!(:manage, current_account)
|
|
authorize!(:manage, current_user)
|
|
authorize!(:manage, EncryptedConfig)
|
|
|
|
impersonate_user(Accounts.find_or_create_testing_user(true_user.account))
|
|
|
|
redirect_back(fallback_location: root_path)
|
|
end
|
|
|
|
def destroy
|
|
stop_impersonating_user
|
|
|
|
redirect_back(fallback_location: root_path)
|
|
end
|
|
end
|