diff --git a/app/controllers/sso_settings_controller.rb b/app/controllers/sso_settings_controller.rb new file mode 100644 index 00000000..9e90d1de --- /dev/null +++ b/app/controllers/sso_settings_controller.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class SsoSettingsController < ApplicationController + before_action :load_encrypted_config + authorize_resource :encrypted_config, only: :index + authorize_resource :encrypted_config, parent: false, except: :index + + def index; end + + private + + def load_encrypted_config + @encrypted_config = + EncryptedConfig.find_or_initialize_by(account: current_account, key: 'saml_configs') + end +end diff --git a/app/views/shared/_settings_nav.html.erb b/app/views/shared/_settings_nav.html.erb index 0f509d74..0feaeb8c 100644 --- a/app/views/shared/_settings_nav.html.erb +++ b/app/views/shared/_settings_nav.html.erb @@ -41,6 +41,13 @@ <%= link_to 'Team', settings_users_path, class: 'text-base hover:bg-base-300' %> <% end %> + <% unless Docuseal.multitenant? %> + <% if can?(:read, EncryptedConfig.new(key: 'saml_configs', account: current_account)) %> +
  • + <%= link_to 'SSO', settings_sso_index_path, class: 'text-base hover:bg-base-300' %> +
  • + <% end %> + <% end %> <% if Docuseal.demo? || !Docuseal.multitenant? %> <% if can?(:read, AccessToken) %>
  • diff --git a/app/views/sso_settings/_placeholder.html.erb b/app/views/sso_settings/_placeholder.html.erb new file mode 100644 index 00000000..476a05f7 --- /dev/null +++ b/app/views/sso_settings/_placeholder.html.erb @@ -0,0 +1,11 @@ +
    + <%= svg_icon('info_circle', class: 'w-6 h-6') %> +
    +

    Single Sign On with SAML 2.0

    +

    + Unlock with DocuSeal Enterprise +
    + ">Learn More +

    +
    +
    diff --git a/app/views/sso_settings/index.html.erb b/app/views/sso_settings/index.html.erb new file mode 100644 index 00000000..ce3d516c --- /dev/null +++ b/app/views/sso_settings/index.html.erb @@ -0,0 +1,8 @@ +
    + <%= render 'shared/settings_nav' %> +
    +

    SMS

    + <%= render 'placeholder' %> +
    +
    +
    diff --git a/app/views/templates_uploads/show.html.erb b/app/views/templates_uploads/show.html.erb index 614a4b5d..ee55c253 100644 --- a/app/views/templates_uploads/show.html.erb +++ b/app/views/templates_uploads/show.html.erb @@ -1,7 +1,6 @@
    + class="text-center p-8 h-full flex items-center justify-center">
    <%= render 'shared/logo', width: 50, height: 50, class: 'mx-auto animate-bounce' %> diff --git a/config/routes.rb b/config/routes.rb index a4699051..d4fb5a91 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -95,6 +95,7 @@ Rails.application.routes.draw do resources :storage, only: %i[index create], controller: 'storage_settings' resources :email, only: %i[index create], controller: 'email_smtp_settings' resources :sms, only: %i[index], controller: 'sms_settings' + resources :sso, only: %i[index], controller: 'sso_settings' end resources :notifications, only: %i[index create], controller: 'notifications_settings' resource :esign, only: %i[show create new update destroy], controller: 'esign_settings'