diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-01-25 16:30:35 +0100 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-01-25 16:30:35 +0100 |
commit | 56e18476feeecf62d9ceded0a356232fc645fa67 (patch) | |
tree | 9acf096135e8ae7b551030fa2ac1fc92ac53579e /application.rb | |
parent | 803d65518c945ca52d5871c553c21cd0628b3d74 (diff) | |
parent | 0fdf7ed7fb5b80c78aaa16f8c75ce11dc3840d6e (diff) |
merged michas GET authorization
Diffstat (limited to 'application.rb')
-rw-r--r-- | application.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/application.rb b/application.rb index a2fbd37..ae4d064 100644 --- a/application.rb +++ b/application.rb @@ -52,6 +52,7 @@ end get '/?' do # get index of models response['Content-Type'] = 'text/uri-list' + params.delete_if{|k,v| k=="subjectid"} ModelStore.all(params).collect{|m| m.uri}.join("\n") + "\n" end @@ -60,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 |