Removing :bulk_update action from actions allowed on nil object, using collection_actions methods on controller instead

This commit is contained in:
Rob Harrington
2015-10-29 11:12:55 +11:00
parent 5a62098b95
commit d01da727f0
4 changed files with 10 additions and 2 deletions

View File

@@ -89,7 +89,7 @@ module Admin
end
def collection_actions
[:index, :for_order_cycle]
[:index, :for_order_cycle, :bulk_update]
end
def current_enterprise

View File

@@ -175,5 +175,9 @@ module Admin
def ams_prefix_whitelist
[:basic]
end
def collection_actions
[:index, :bulk_update]
end
end
end

View File

@@ -63,5 +63,9 @@ module Admin
def collection
end
def collection_actions
[:index, :bulk_update]
end
end
end

View File

@@ -66,7 +66,7 @@ class AbilityDecorator
def add_enterprise_management_abilities(user)
# Spree performs authorize! on (:create, nil) when creating a new order from admin, and also (:search, nil)
# when searching for variants to add to the order
can [:create, :search, :bulk_update], nil
can [:create, :search], nil
can [:admin, :index], :overview