Support sudo admin switch for async dashboard caching

This commit is contained in:
Alexander Meindl 2021-02-06 07:24:05 +01:00
parent 45c6530586
commit 563ff4d961

View File

@ -303,7 +303,10 @@ class Dashboard < ActiveRecord::Base
config = { dashboard_id: id,
block: block }
settings[:user_id] = User.current.id if !options.key?(:skip_user_id) || !options[:skip_user_id]
if !options.key?(:skip_user_id) || !options[:skip_user_id]
settings[:user_id] = User.current.id
settings[:user_is_admin] = User.current.admin?
end
if settings.present?
settings.each do |key, setting|