biola_wcms_components 0.21.0 → 0.22.0
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/app/controllers/wcms_application_controller.rb +26 -2
- data/lib/biola_wcms_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21c30dd6c4f6db3bc50b76f3e6053bd5ea646aee
|
4
|
+
data.tar.gz: ad1c68725ca7097d71eaa323d1e29a6fae56b247
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2598f4e0b5d374a740e476f77beaac3a3a84de77c0e7e824e029be15faf1758918a651efa96fb3c2dbd4b0d12710aa11aad9ecf4505690f1d67d8d831e5a7f3b
|
7
|
+
data.tar.gz: 28c07809f5e03bcc388fbd220aa66f868d5ba665e0acfe2abfbd10c37b1e7403d5183a8e8158bc0cd441ae04cc6535ff6dc933435c7f7af6366d6d7e5cb2924b
|
data/CHANGELOG.md
CHANGED
@@ -9,13 +9,37 @@ class WcmsApplicationController < ActionController::Base
|
|
9
9
|
|
10
10
|
layout -> { (@layout || :application).to_s }
|
11
11
|
|
12
|
-
|
13
|
-
def current_user
|
12
|
+
def true_user
|
14
13
|
authentication.user
|
15
14
|
end
|
15
|
+
helper_method :true_user
|
16
|
+
|
17
|
+
def current_user
|
18
|
+
unless @current_user
|
19
|
+
# clear impersonation_id if true_user is not logged in
|
20
|
+
if session[:impersonation_id] && !true_user
|
21
|
+
session[:impersonation_id] = nil
|
22
|
+
end
|
23
|
+
|
24
|
+
# Fetch impersonated user from their ID, otherwise return true_user
|
25
|
+
@current_user = (session[:impersonation_id] && User.where(id: session[:impersonation_id]).first) || true_user
|
26
|
+
end
|
27
|
+
@current_user
|
28
|
+
end
|
29
|
+
helper_method :current_user
|
16
30
|
|
17
31
|
protected
|
18
32
|
|
33
|
+
def impersonate_user(user)
|
34
|
+
@current_user = user
|
35
|
+
session[:impersonation_id] = user.id.to_s
|
36
|
+
end
|
37
|
+
|
38
|
+
def stop_impersonating_user
|
39
|
+
@impersonated_var = true_user
|
40
|
+
session[:impersonation_id] = nil
|
41
|
+
end
|
42
|
+
|
19
43
|
def authenticate!
|
20
44
|
authentication.perform or render_error_page(401)
|
21
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: biola_wcms_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Hall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ace-rails-ap
|