diff --git a/app/controllers/admin/dashboards_controller.rb b/app/controllers/admin/dashboards_controller.rb index 3ff70e8e0..5fe263e22 100644 --- a/app/controllers/admin/dashboards_controller.rb +++ b/app/controllers/admin/dashboards_controller.rb @@ -1,5 +1,7 @@ class Admin::DashboardsController < AdminController authorize_resource class: false - def show; end + def show + redirect_to [:admin, :domains] if can? :show, Domain + end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1acd32396..20ead7a06 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -11,7 +11,7 @@ class ApplicationController < ActionController::Base def after_sign_in_path_for(_resource) return session[:user_return_to].to_s if session[:user_return_to] && session[:user_return_to] != login_path - admin_root_path + admin_dashboard_path end end diff --git a/app/views/layouts/application.haml b/app/views/layouts/application.haml index 8bf33ea3f..d0cc031d5 100644 --- a/app/views/layouts/application.haml +++ b/app/views/layouts/application.haml @@ -20,7 +20,7 @@ %span.icon-bar %span.icon-bar %span.icon-bar - = link_to root_path, class: 'navbar-brand' do + = link_to admin_dashboard_path, class: 'navbar-brand' do = APP_CONFIG['app_name'] - if unstable_env.present? .text-center @@ -28,10 +28,14 @@ .navbar-collapse.collapse %ul.nav.navbar-nav - %li= link_to t('domains'), admin_domains_path - %li= link_to t('contacts'), admin_contacts_path - %li= link_to t('registrars'), admin_registrars_path - %li= link_to t('keyrelays'), admin_keyrelays_path + - if can? :show, Domain + %li= link_to t('domains'), admin_domains_path + - if can? :show, Contact + %li= link_to t('contacts'), admin_contacts_path + - if can? :show, Registrar + %li= link_to t('registrars'), admin_registrars_path + - if can? :show, Keyrelay + %li= link_to t('keyrelays'), admin_keyrelays_path - if can?(:access, :settings_menu) %li.dropdown %a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}