thecore_ui_rails_admin 3.0.10 → 3.0.11

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: a21cf5cb664889b6398225db6b03f6eecee4b2b7a5b40be20faaaa74fc2a00b6
4
- data.tar.gz: 0c8ddc740f438d4f92485486772f43f50eb4642f3ca49688f331c32b2442e552
3
+ metadata.gz: 4bf27ee7eca3087e172ee00292bf64da89ec995b08f6d66bd4f40ff4a206b5a6
4
+ data.tar.gz: d54c5989b45da0031062d4e301d5e349e756d6edb0f2059b1abe767dc435ec46
5
5
  SHA512:
6
- metadata.gz: 1436b2d2c1330ba34395f1e487eb8db6b2ccbfeeee25520ecea3adfa23ad692bcefe940981d3190ff6b75545f5daef963e1d190691aab6d1899cfd272f0427f2
7
- data.tar.gz: 3f2e1dc873dfb209b3af05e6aa233e57cd66607d69c25a350c07cd051991a19df1a99fc797afe08af61ae2eda415dc928a45013660efe565215b3e5b273bd90f
6
+ metadata.gz: f148d09a4a1748828a8e16fcdd09f6d9a187a03cfb3923ca71d396e54365ae2bd75d8aa9ecc8c1cf6cd8522355af945ca9dd0dffee1ff4c91722b936786e5681
7
+ data.tar.gz: b3edfd4c67221520f5aff672dd9d5c3147eeef47c14e9dc48d944dce7de521c75774e9d530052a1c206d3ef7495714560cd737a87168f28bcf4e96a006091c1a
@@ -4,17 +4,15 @@ Rails.application.configure do
4
4
  RailsAdmin::Config.sidescroll = { num_frozen_columns: 2 }
5
5
 
6
6
  RailsAdmin::Config.main_app_name = Proc.new { |controller| [ ((ENV["APP_NAME"].presence || Settings.app_name.presence) rescue "Thecore"), "" ] }
7
- # Link for background Job
8
- # (config.navigation_static_links ||= {}).merge! "Background Monitor" => "#{ENV["BACKEND_URL"].presence || "http://localhost:3000"}/sidekiq"
9
7
 
10
- ### Popular gems integration
11
- ## == Devise ==
12
- RailsAdmin::Config.authenticate_with { warden.authenticate! scope: :user }
8
+ # ### Popular gems integration
9
+ # # ## == Devise ==
10
+ # RailsAdmin::Config.authenticate_with { warden.authenticate! scope: :user }
13
11
 
14
- RailsAdmin::Config.current_user_method(&:current_user)
12
+ # RailsAdmin::Config.current_user_method(&:current_user)
15
13
 
16
- ## == Cancan ==
17
- RailsAdmin::Config.authorize_with :cancancan
14
+ # # ## == Cancan ==
15
+ # RailsAdmin::Config.authorize_with :cancancan
18
16
 
19
17
  ## == PaperTrail ==
20
18
  # config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0
@@ -2,13 +2,15 @@ require 'active_support/concern'
2
2
 
3
3
  module ThecoreUiRailsAdminActionControllerConcern
4
4
  extend ActiveSupport::Concern
5
-
5
+
6
6
  included do
7
7
  # Prevent CSRF attacks by raising an exception.
8
8
  # For APIs, you may want to use :null_session instead.
9
9
  # layout 'thecore'
10
10
  puts "Protecting from Forgery with exception and prepend"
11
- protect_from_forgery with: :exception, prepend: true, except: :sign_in
11
+ # protect_from_forgery with: :reset_session
12
+ skip_forgery_protection
13
+
12
14
  rescue_from CanCan::AccessDenied do |exception|
13
15
  redirect_to main_app.root_url, alert: exception.message
14
16
  end
@@ -105,9 +107,9 @@ module ThecoreUiRailsAdminActionControllerConcern
105
107
 
106
108
  # Auto-sign out locked users
107
109
  def reject_locked!
108
- # Rails.logger.info "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB reject_locked"
110
+ puts "reject_locked #{current_user}"
109
111
  if !current_user.blank? && current_user.locked?
110
- # Rails.logger.info "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB is locked"
112
+ puts " - Cleaning session"
111
113
  sign_out current_user
112
114
  user_session = nil
113
115
  current_user = nil
@@ -121,6 +123,7 @@ module ThecoreUiRailsAdminActionControllerConcern
121
123
 
122
124
  # Only permits admin users
123
125
  def require_admin!
126
+ puts "require_admin! #{current_user}"
124
127
  authenticate_user!
125
128
 
126
129
  if current_user && !current_user.admin?
@@ -21,12 +21,12 @@ module ThecoreUiRailsAdminUserConcern
21
21
  end
22
22
  field :admin do
23
23
  visible do
24
- bindings[:view].current_user.admin? && bindings[:view].current_user.id != bindings[:object].id
24
+ bindings[:view].current_user.admin? && bindings[:view].current_user.id != bindings[:object].id rescue false
25
25
  end
26
26
  end
27
27
  field :locked do
28
28
  visible do
29
- bindings[:view].current_user.admin? && bindings[:view].current_user.id != bindings[:object].id
29
+ bindings[:view].current_user.admin? && bindings[:view].current_user.id != bindings[:object].id rescue false
30
30
  end
31
31
  end
32
32
  field :roles#, :selectize
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_ui_rails_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.10
4
+ version: 3.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni