diff options
author | mr <mr@mrautenberg.de> | 2011-01-18 11:29:42 +0100 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2011-01-18 11:29:42 +0100 |
commit | 0fdf7ed7fb5b80c78aaa16f8c75ce11dc3840d6e (patch) | |
tree | 3a48a20458795f356befc004a4f60beaca76d02e /application.rb | |
parent | 6a94d2a6922b63d698e0085d1e6221990802c867 (diff) |
get subjectid from api-wrapper helper
Diffstat (limited to 'application.rb')
-rw-r--r-- | application.rb | 9 |
1 files changed, 4 insertions, 5 deletions
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 |