mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Hide links when no rights, dashboard redirects to domains
This commit is contained in:
parent
127a4fc28e
commit
a4ebb24a03
3 changed files with 13 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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,9 +28,13 @@
|
|||
|
||||
.navbar-collapse.collapse
|
||||
%ul.nav.navbar-nav
|
||||
- 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue