add authorize

pull/721/head
Pete Matsyburka 2 weeks ago
parent ec04a95e36
commit e0b0d4e803

@ -23,17 +23,20 @@ class AccountsController < ApplicationController
unless Docuseal.multitenant?
@encrypted_config = EncryptedConfig.find_or_initialize_by(account: current_account,
key: EncryptedConfig::APP_URL_KEY)
@encrypted_config.assign_attributes(app_url_params)
unless URI.parse(@encrypted_config.value.to_s).class.in?([URI::HTTP, URI::HTTPS])
@encrypted_config.errors.add(:value, I18n.t('should_be_a_valid_url'))
if can?(:manage, @encrypted_config)
@encrypted_config.assign_attributes(app_url_params)
return render :show, status: :unprocessable_content
end
unless URI.parse(@encrypted_config.value.to_s).class.in?([URI::HTTP, URI::HTTPS])
@encrypted_config.errors.add(:value, I18n.t('should_be_a_valid_url'))
return render :show, status: :unprocessable_content
end
@encrypted_config.save!
@encrypted_config.save!
Docuseal.refresh_default_url_options!
Docuseal.refresh_default_url_options!
end
end
with_locale do

Loading…
Cancel
Save