Skip to content

Commit

Permalink
Only allow admins to pass show_deleted parameter
Browse files Browse the repository at this point in the history
Relates to spree#1626
  • Loading branch information
radar committed Jun 3, 2012
1 parent 4a75480 commit 25efab3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/app/controllers/spree/api/v1/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ def find_product(id)
def product_scope
if current_api_user.has_role?("admin")
scope = Product
unless params[:show_deleted]
scope = scope.not_deleted
end
else
scope = Product.active
end
unless params[:show_deleted]
scope = scope.not_deleted
end

scope.includes(:master)
end
Expand Down

0 comments on commit 25efab3

Please sign in to comment.