From 2ad4aaab472a41969a56ca79e613044c45ede788 Mon Sep 17 00:00:00 2001 From: rautenberg Date: Mon, 2 Jul 2012 16:17:45 +0200 Subject: turn off policy creation --- application.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/application.rb b/application.rb index e4f5044..fc4d9eb 100644 --- a/application.rb +++ b/application.rb @@ -305,12 +305,12 @@ post '/?' do @json_file = "#{@@datadir}/#{@id}.json" if params.size == 0 and input_data.size==0 File.open(@json_file,"w+"){|f| f.puts OpenTox::Dataset.new(@uri).to_json} - OpenTox::Authorization.check_policy(@uri, @subjectid) if File.exists? @json_file + #OpenTox::Authorization.check_policy(@uri, @subjectid) if File.exists? @json_file @uri else task = OpenTox::Task.create("Converting and saving dataset ", @uri) do load_dataset @id, params, request.content_type, input_data - OpenTox::Authorization.check_policy(@uri, @subjectid) if File.exists? @json_file + #OpenTox::Authorization.check_policy(@uri, @subjectid) if File.exists? @json_file @uri end raise OpenTox::ServiceUnavailableError.newtask.uri+"\n" if task.status == "Cancelled" @@ -346,14 +346,14 @@ delete '/:id' do LOGGER.debug "deleting dataset with id #{@id}" begin FileUtils.rm Dir["#{@@datadir}/#{@id}.*"] - if @subjectid and !File.exists? @json_file and @uri - begin - res = OpenTox::Authorization.delete_policies_from_uri(@uri, @subjectid) - LOGGER.debug "Policy deleted for Dataset URI: #{@uri} with result: #{res}" - rescue - LOGGER.warn "Policy delete error for Dataset URI: #{@uri}" - end - end + #if @subjectid and !File.exists? @json_file and @uri + # begin + # #res = OpenTox::Authorization.delete_policies_from_uri(@uri, @subjectid) + # #LOGGER.debug "Policy deleted for Dataset URI: #{@uri} with result: #{res}" + # rescue + # #LOGGER.warn "Policy delete error for Dataset URI: #{@uri}" + # end + #end response['Content-Type'] = 'text/plain' "Dataset #{@id} deleted." rescue -- cgit v1.2.3