From 8d37c738cd067b7b8757a4a5249279349662ff9c Mon Sep 17 00:00:00 2001 From: Dolsy Smith Date: Thu, 7 Mar 2024 15:01:59 +0000 Subject: [PATCH] Removed registration link --- app/models/user.rb | 2 +- config/routes.rb | 2 +- lib/tasks/update_users_sso.rake | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 3a977ccb..7f04ca39 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -18,7 +18,7 @@ class User < ApplicationRecord include Blacklight::User # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable - devise :database_authenticatable, :registerable, + devise :database_authenticatable, #:registerable, :recoverable, :rememberable, :trackable, :validatable, :omniauthable, omniauth_providers: [:saml] diff --git a/config/routes.rb b/config/routes.rb index 9940b748..3e205193 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -28,7 +28,7 @@ mount Hydra::RoleManagement::Engine => '/' mount Qa::Engine => '/authorities' - mount Hyrax::Engine, at: '/'#, constraints: DashboardAdminOnlyConstraint.new + mount Hyrax::Engine, at: '/' resources :welcome, only: 'index' root 'hyrax/homepage#index' curation_concerns_basic_routes diff --git a/lib/tasks/update_users_sso.rake b/lib/tasks/update_users_sso.rake index 7daaf958..9bae70ea 100644 --- a/lib/tasks/update_users_sso.rake +++ b/lib/tasks/update_users_sso.rake @@ -11,8 +11,15 @@ namespace :gwss do if gw_email.match(user.email) user.uid = user.email user.provider = "saml" + puts "Updating user #{user.email}" user.save + else + if (!user.admin?) & (!user.contentadmin?) + puts "Deleting user #{user.email}" + user.destroy + end end + end end end \ No newline at end of file