Authorize access to admin panel, etc.

Adds a separate admin namespace and base controller, with authorization
by looking up the admin property in the user's LDAP account.
This commit is contained in:
2020-11-18 00:22:44 +01:00
parent 6614f14d8a
commit f0312cb8e7
13 changed files with 58 additions and 11 deletions

View File

@@ -3,8 +3,8 @@
en:
devise:
confirmations:
confirmed: "Your email address has been successfully confirmed."
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
confirmed: "Your email address has been confirmed. You can now log in below."
send_instructions: "You will receive an email with instructions for how to confirm your email address in a moment."
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
failure:
already_authenticated: "You are already signed in."

View File

@@ -7,7 +7,10 @@ Rails.application.routes.draw do
get 'welcome', to: 'welcome#index'
get 'check_your_email', to: 'welcome#check_your_email'
get 'ldap_users', to: 'ldap_users#index'
namespace :admin do
root to: 'dashboard#index'
get 'ldap_users', to: 'ldap_users#index'
end
# Letter Opener (open "sent" emails in dev and staging)
if Rails.env.match(/staging|development/)