thecore_ui_rails_admin 2.3.3 → 2.4.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/config/initializers/thecore_concern.rb +24 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cf5ef77b7350f3b3db1ac10329ff211c6912d81af8deb7ccfef64e2a44fb703a
|
|
4
|
+
data.tar.gz: 6fc7f5a2c50d3ecdc9520c8b95bf533d520fa5b41b2eb00d392501df2af46b91
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b36f604e772e954819f8661e6788d59e174e95b73a9bc97a5411e85123f69a56dde2f9dd48e93e2c6c7067405d5b8d5b5fdf2b6af3fddf69ef8eff63cd0b41f
|
|
7
|
+
data.tar.gz: a97f275432de1a5812d7408612dda0704091079dd3f3703de611359a71674c4d5a4bdf582d2dc07a0c01c52e766e7c8784139fc41f994056a05a6f06d5cb78d3
|
|
@@ -9,7 +9,7 @@ module ThecoreConcern
|
|
|
9
9
|
layout 'thecore'
|
|
10
10
|
protect_from_forgery with: :exception, prepend: true
|
|
11
11
|
rescue_from CanCan::AccessDenied do |exception|
|
|
12
|
-
redirect_to main_app.root_url, :
|
|
12
|
+
redirect_to main_app.root_url, alert: exception.message
|
|
13
13
|
end
|
|
14
14
|
include HttpAcceptLanguage::AutoLocale
|
|
15
15
|
before_action :store_user_location!, if: :storable_location?
|
|
@@ -31,9 +31,25 @@ module ThecoreConcern
|
|
|
31
31
|
# Rails.logger.debug "ROOT ACTIONS: #{root_actions.inspect}"
|
|
32
32
|
# GETTING THE FIRST ACTION I CAN MANAGE
|
|
33
33
|
action = root_actions.collect(&:action_name).first
|
|
34
|
-
# Rails.logger.debug "FIRST ACTION: #{action}"
|
|
35
34
|
# REDIRECT TO THAT ACTION
|
|
36
|
-
|
|
35
|
+
|
|
36
|
+
Rails.logger.info "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA: Checking redirect path"
|
|
37
|
+
stored_location = stored_location_for(resource)
|
|
38
|
+
if !stored_location.blank? && can?(resource, :all)
|
|
39
|
+
Rails.logger.info "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA: Checking redirect path: I'm in the IF stored_location_for(resource): #{stored_location}"
|
|
40
|
+
return stored_location
|
|
41
|
+
elsif action
|
|
42
|
+
Rails.logger.info "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA: Checking redirect path: I'm in the ELSIF with action name: #{action}"
|
|
43
|
+
return rails_admin.send("#{action}_path").sub("#{ENV['RAILS_RELATIVE_URL_ROOT']}#{ENV['RAILS_RELATIVE_URL_ROOT']}", "#{ENV['RAILS_RELATIVE_URL_ROOT']}")
|
|
44
|
+
else
|
|
45
|
+
Rails.logger.info "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA: Checking redirect path: I'm in the ELSE with root_path: #{root_path}"
|
|
46
|
+
sign_out current_user
|
|
47
|
+
user_session = nil
|
|
48
|
+
current_user = nil
|
|
49
|
+
flash[:alert] = "Your user is not authorized to access any page."
|
|
50
|
+
flash[:notice] = nil
|
|
51
|
+
return root_path
|
|
52
|
+
end
|
|
37
53
|
end
|
|
38
54
|
end
|
|
39
55
|
|
|
@@ -89,7 +105,9 @@ module ThecoreConcern
|
|
|
89
105
|
|
|
90
106
|
# Auto-sign out locked users
|
|
91
107
|
def reject_locked!
|
|
92
|
-
|
|
108
|
+
Rails.logger.info "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB reject_locked"
|
|
109
|
+
if !current_user.blank? && current_user.locked?
|
|
110
|
+
Rails.logger.info "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB is locked"
|
|
93
111
|
sign_out current_user
|
|
94
112
|
user_session = nil
|
|
95
113
|
current_user = nil
|
|
@@ -97,7 +115,9 @@ module ThecoreConcern
|
|
|
97
115
|
flash[:notice] = nil
|
|
98
116
|
redirect_to root_url
|
|
99
117
|
end
|
|
118
|
+
Rails.logger.info "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB is not locked = ok"
|
|
100
119
|
end
|
|
120
|
+
|
|
101
121
|
|
|
102
122
|
# Only permits admin users
|
|
103
123
|
def require_admin!
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: thecore_ui_rails_admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gabriele Tassoni
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-06
|
|
11
|
+
date: 2021-07-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thecore_ui_commons
|