lib/hydra/controller/assets_controller_behavior.rb in hydra-head-4.1.2 vs lib/hydra/controller/assets_controller_behavior.rb in hydra-head-4.1.3
- old
+ new
@@ -97,9 +97,10 @@
redirect_to edit_catalog_path(@asset.pid, :new_asset=>true)
end
def destroy
af = ActiveFedora::Base.find(params[:id], :cast=>true)
+ authorize! :destroy, af
assets = af.destroy_child_assets
af.delete
msg = "Deleted #{params[:id]}"
msg.concat(" and associated file_asset(s): #{assets.join(", ")}") unless assets.empty?
flash[:notice]= msg