add require file links auth toggle

This commit is contained in:
Pete Matsyburka
2024-04-15 19:58:24 +03:00
parent 652b0da021
commit fc679bcd72
6 changed files with 43 additions and 8 deletions
+12
View File
@@ -75,6 +75,18 @@
</div>
<% end %>
<% end %>
<% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::DOWNLOAD_LINKS_AUTH_KEY) %>
<% if can?(:manage, account_config) %>
<%= form_for account_config, url: account_configs_path, method: :post do |f| %>
<%= f.hidden_field :key %>
<div class="flex items-center justify-between py-2.5">
<span>
Require authorization for file download links
</span>
<%= f.check_box :value, class: 'toggle', checked: account_config.value, onchange: 'this.form.requestSubmit()' %>
</div>
<% end %>
<% end %>
</div>
<% end %>
<% if can?(:manage, current_account) && Docuseal.multitenant? && true_user == current_user %>