Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import preview and vulnerabilities [1.9] #576

Merged
merged 2 commits into from
Dec 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ GEM
concurrent-ruby (1.1.4)
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.4)
crass (1.0.5)
d3-rails (3.5.2)
railties (>= 3.1)
daemons (1.2.6)
Expand Down Expand Up @@ -321,7 +321,7 @@ GEM
addressable (~> 2.3)
libv8 (3.16.14.19)
locale (2.1.2)
loofah (2.2.3)
loofah (2.4.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
Expand All @@ -340,7 +340,7 @@ GEM
net_tcp_client (2.0.1)
netstring (0.0.3)
nio4r (2.3.1)
nokogiri (1.10.4)
nokogiri (1.10.7)
mini_portile2 (~> 2.4.0)
oj (2.18.5)
orm_adapter (0.5.0)
Expand All @@ -355,7 +355,7 @@ GEM
pg (1.0.0)
powerpack (0.1.2)
public_suffix (3.0.3)
puma (3.12.1)
puma (3.12.2)
puma_worker_killer (0.1.0)
get_process_mem (~> 0.2)
puma (>= 2.7, < 4)
Expand Down
3 changes: 3 additions & 0 deletions app/policies/role_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def perform?
alias_rule :import?, to: :perform? # ActiveAdminImport::Auth::IMPORT
alias_rule :do_import?, to: :import? # active_admin_import

alias_rule :batch_insert?, :batch_replace?, :batch_update?, :delete_all?,
to: :perform?

private

# action could be one of [:read, :change, :remove, :perform]
Expand Down
2 changes: 1 addition & 1 deletion lib/resource_dsl/acts_as_import_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def acts_as_import_preview
scope :for_update

redirect_proc = proc do
active_admin_config.namespace.resource_for(config.resource_class.import_class).route_collection_path
active_admin_config.namespace.resource_for(active_admin_config.resource_class.import_class).route_collection_path
end

acts_as_import_resource_class = config.resource_class
Expand Down