ucb_rails_user 4.0.0 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f0be1d4383707c2e5a164251c52e869e0460acdef55ca4e2e8bdfdccbb72666
4
- data.tar.gz: b9bc3be3b9fa44c998ceadcba16840b5b10a470671a684ce1da4b1f29f9d8068
3
+ metadata.gz: 16591e2634ccad69a102f688132f754064005db006c45a1cdc59a66f186e299a
4
+ data.tar.gz: 197103ec64e41e156973745bd90cf810c6ac85b1d0e945395fb300d322326f0c
5
5
  SHA512:
6
- metadata.gz: 5f01d2e8adf96825c5c9ac54e6649ef1cb15945a986572a486a22873cc12302ccea6e18f9671d9d16de6ba7a8d8b75e9576db9fd492bf05ba245437a79704294
7
- data.tar.gz: 7564793fe361acd435b7afb47796db81af39e8fb1e119ccb0ac709798bbb9a2c17a6351e3ec8c9d1ce24384381bfb4141000db8e81ae54ccad9257d45b464abb
6
+ metadata.gz: 66e533e5bcf094769bd727ef8e9c651b9e2b3720a82ab36ebcdd0e27f5403db745fe44af8931ee68295edd95cc071771cd65014123a2b972125617b14934bf14
7
+ data.tar.gz: 1031c24d8efe19130e8f8f4b6e961b7ef15447f27c7b0e35da5940979d848015f4099a7a7d8d41b24a921311130a87965349db2f39d314b08dcea8d74cb67891
data/README.md CHANGED
@@ -16,7 +16,7 @@ This engine also includes the [Datatables](https://datatables.net/) JQuery plug-
16
16
 
17
17
  Version 2.0 and greater of this gem sets a user's `employee_id` to the new UCPath employee id, rather than the legacy HCM employee id. If you need to use the older ID, use version 1.1.3 of this gem, or lower.
18
18
 
19
- ## Upgrading to version 3.0 from version 2.x
19
+ ## Upgrading to version 3.0+ from version 2.x
20
20
 
21
21
  See [this wiki page](https://github.com/ucb-ist-eas/ucb_rails_user/wiki/Upgrading-to-version-3.0) for details.
22
22
 
@@ -2,7 +2,7 @@ module UcbRailsUser::Concerns::HomeController
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  included do
5
- skip_before_action :ensure_authenticated_user
5
+ skip_before_action :ensure_authenticated_user, raise: false
6
6
  end
7
7
 
8
8
  def index
@@ -2,7 +2,7 @@ module UcbRailsUser::Concerns::SessionsController
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  included do
5
- skip_before_action :ensure_authenticated_user, :log_request
5
+ skip_before_action :ensure_authenticated_user, :log_request, raise: false
6
6
  end
7
7
 
8
8
  # Redirects to authentication provider
@@ -4,7 +4,7 @@ module UcbRailsUser::Concerns::UsersController
4
4
  included do
5
5
  before_action :find_user, :only => [:edit, :update, :destroy]
6
6
  before_action :ensure_admin_user
7
- skip_before_action :ensure_admin_user, if: ->{ action_name == "toggle_superuser" && Rails.env.development? }
7
+ skip_before_action :ensure_admin_user, if: ->{ action_name == "toggle_superuser" && Rails.env.development? }, raise: false
8
8
  end
9
9
 
10
10
  def index
@@ -56,7 +56,7 @@ module UcbRailsUser::Concerns::UsersController
56
56
  end
57
57
 
58
58
  def update
59
- if @user.update_attributes(user_params)
59
+ if @user.update(user_params)
60
60
  redirect_to(admin_users_path, notice: 'Record updated')
61
61
  else
62
62
  render("edit")
@@ -76,7 +76,7 @@ module UcbRailsUser::Concerns::UsersController
76
76
  def ldap_search
77
77
  # FIXME: this was retrofitted to support typeahead ajax json queries
78
78
  if(query = params[:query])
79
- @lps_entries = UcbRails::OmniUserTypeahead.new.ldap_results(query)
79
+ @lps_entries = UcbRailsUser::OmniUserTypeahead.new.ldap_results(query)
80
80
  @lps_entries.map!{|entry|
81
81
  attrs = entry.attributes.tap{|attrs| attrs["first_last_name"] = "#{attrs['first_name']} #{attrs['last_name']}" }
82
82
  attrs.as_json
@@ -85,13 +85,14 @@ module UcbRailsUser::Concerns::UsersController
85
85
  render json: @lps_entries
86
86
 
87
87
  else
88
- @lps_entries = UcbRails::LdapPerson::Finder.find_by_first_last(
88
+ @lps_entries = UcbRailsUser::LdapPerson::Finder.find_by_first_last(
89
89
  params.fetch(:first_name),
90
90
  params.fetch(:last_name),
91
91
  :sort => :last_first_downcase
92
92
  )
93
- @lps_existing_uids = User.where(ldap_uid: @lps_entries.map(&:uid)).pluck(:uid)
94
- render 'lps/search'
93
+ uid_strings = @lps_entries.map { |entry| entry.uid&.to_s }.compact
94
+ @lps_existing_uids = User.where(ldap_uid: uid_strings).pluck(:uid)
95
+ render 'ucb_rails_user/lps/search'
95
96
  end
96
97
 
97
98
  end
@@ -2,7 +2,8 @@ module UserConcerns
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  included do
5
- has_many :impersonations, class_name: "::UcbRailsUser::Impersonation"
5
+ has_many :impersonations, class_name: "::UcbRailsUser::Impersonation", dependent: :delete_all
6
+ has_many :targets, class_name: "::UcbRailsUser::Impersonation", dependent: :delete_all
6
7
  end
7
8
 
8
9
  # Overridden by application
@@ -3,8 +3,6 @@ module UcbRailsUser::Concerns::ImpersonationConcerns
3
3
 
4
4
  included do
5
5
  belongs_to :user
6
- belongs_to :target, class_name: "User"
6
+ belongs_to :target, class_name: 'User'
7
7
  end
8
-
9
8
  end
10
-
data/config/routes.rb CHANGED
@@ -17,6 +17,8 @@ Rails.application.routes.draw do
17
17
  as: "admin_user_search", via: [:get]
18
18
  match "/admin/users/impersonate_search", to: UcbRailsUser::UsersController.action(:impersonate_search),
19
19
  as: "admin_user_impersonate_search", via: [:get]
20
+ match "/admin/users/ldap_search", to: UcbRailsUser::UsersController.action(:ldap_search),
21
+ as: "admin_user_ldap_search", via: [:get]
20
22
  resources :users, controller: "ucb_rails_user/users", path: "admin/users", as: :admin_users
21
23
 
22
24
  resources :impersonations, controller: "ucb_rails_user/impersonations", path: "admin/impersonations", as: :admin_impersonations
@@ -1,3 +1,3 @@
1
1
  module UcbRailsUser
2
- VERSION = '4.0.0'
2
+ VERSION = '4.0.5'
3
3
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ucb_rails_user
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Downey
8
8
  - Peter Philips
9
9
  - Tyler Minard
10
10
  - Darin Wilson
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-02-27 00:00:00.000000000 Z
14
+ date: 2021-03-29 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -47,14 +47,14 @@ dependencies:
47
47
  requirements:
48
48
  - - "~>"
49
49
  - !ruby/object:Gem::Version
50
- version: '1.0'
50
+ version: '2.0'
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - "~>"
56
56
  - !ruby/object:Gem::Version
57
- version: '1.0'
57
+ version: '2.0'
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: active_attr
60
60
  requirement: !ruby/object:Gem::Requirement
@@ -341,7 +341,7 @@ homepage: https://github.com/ucb-ist-eas/ucb_rails_user
341
341
  licenses:
342
342
  - MIT
343
343
  metadata: {}
344
- post_install_message:
344
+ post_install_message:
345
345
  rdoc_options: []
346
346
  require_paths:
347
347
  - lib
@@ -356,8 +356,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
356
356
  - !ruby/object:Gem::Version
357
357
  version: '0'
358
358
  requirements: []
359
- rubygems_version: 3.0.1
360
- signing_key:
359
+ rubygems_version: 3.1.2
360
+ signing_key:
361
361
  specification_version: 4
362
362
  summary: Rails engine for UCB user accounts
363
363
  test_files: []