From 0fdf7ed7fb5b80c78aaa16f8c75ce11dc3840d6e Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 18 Jan 2011 11:29:42 +0100 Subject: get subjectid from api-wrapper helper --- application.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'application.rb') diff --git a/application.rb b/application.rb index 4fc749d..ae4d064 100644 --- a/application.rb +++ b/application.rb @@ -61,12 +61,11 @@ delete '/:id/?' do uri = ModelStore.get(params[:id]).uri ModelStore.get(params[:id]).destroy! "Model #{params[:id]} deleted." - subjectid = params[:subjectid] if params[:subjectid] - subjectid = request.env['HTTP_SUBJECTID'] if !subjectid and request.env['HTTP_SUBJECTID'] - if subjectid and !ModelStore.get(params[:id]) and uri + + if @subjectid and !ModelStore.get(params[:id]) and uri begin - res = OpenTox::Authorization.delete_policies_from_uri(uri, subjectid) - LOGGER.debug "Policy deleted for Model URI: #{uri} with subjectid: #{subjectid} with result: #{res}" + res = OpenTox::Authorization.delete_policies_from_uri(uri, @subjectid) + LOGGER.debug "Policy deleted for Model URI: #{uri} with subjectid: #{@subjectid} with result: #{res}" rescue LOGGER.warn "Policy delete error for Model URI: #{uri}" end -- cgit v1.2.3