diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 0f5ab590..c447fd6c 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -54,10 +54,14 @@ class DashboardController < ApplicationController rel = templates.active.preload(:author).order(id: :desc) if params[:q].blank? - shared_template_ids = - TemplateSharing.where(account_id: [current_account.id, TemplateSharing::ALL_ID]).select(:template_id) - - rel = rel.where(folder_id: current_account.default_template_folder.id).or(rel.where(id: shared_template_ids)) + if Docuseal.multitenant? + rel = rel.where(folder_id: current_account.default_template_folder.id) + else + shared_template_ids = + TemplateSharing.where(account_id: [current_account.id, TemplateSharing::ALL_ID]).select(:template_id) + + rel = rel.where(folder_id: current_account.default_template_folder.id).or(rel.where(id: shared_template_ids)) + end end Templates.search(rel, params[:q]) diff --git a/app/views/templates_code_modal/show.html.erb b/app/views/templates_code_modal/show.html.erb index b20cf352..ffab41b9 100644 --- a/app/views/templates_code_modal/show.html.erb +++ b/app/views/templates_code_modal/show.html.erb @@ -18,7 +18,7 @@ <%= render 'templates/embedding', template: @template %> - <% if can?(:manage, TemplateSharing.new(template: @template)) %> + <% if can?(:manage, TemplateSharing.new(template: @template)) && !Docuseal.multitenant? %> <%= form_for '', url: template_sharings_testing_index_path, method: :post, html: { class: 'mt-1' } do |f| %> <%= f.hidden_field :template_id, value: @template.id %>