From 4e5063039fd2207799e76b9afd97614c1091303b Mon Sep 17 00:00:00 2001 From: rautenberg Date: Thu, 25 Apr 2013 10:43:30 +0200 Subject: add basic AA --- lib/opentox.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/opentox.rb') diff --git a/lib/opentox.rb b/lib/opentox.rb index 309a47d..80df507 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -100,6 +100,7 @@ module OpenTox when 'application/rdf+xml' body = self.to_rdfxml end + Authorization.check_policy(@uri, @subjectid) if $aa[:uri] uri = RestClientWrapper.post @uri.to_s, body, { :content_type => mime_type, :subjectid => @subjectid} wait ? wait_for_task(uri) : uri end @@ -113,6 +114,7 @@ module OpenTox when 'application/rdf+xml' body = self.to_rdfxml end + Authorization.check_policy(@uri, @subjectid) if $aa[:uri] uri = RestClientWrapper.put @uri.to_s, body, { :content_type => mime_type, :subjectid => @subjectid} wait ? wait_for_task(uri) : uri end @@ -120,6 +122,7 @@ module OpenTox # Delete object at webservice def delete RestClientWrapper.delete(@uri.to_s,nil,{:subjectid => @subjectid}) + Authorization.delete_policies_from_uri(@uri, @subjectid) if $aa[:uri] end def service_uri @@ -191,7 +194,7 @@ module OpenTox include OpenTox def self.all subjectid=nil - uris = RestClientWrapper.get(service_uri, {}, :accept => 'text/uri-list').split("\n").compact + uris = RestClientWrapper.get(service_uri, {}, :accept => 'text/uri-list', :subjectid => subjectid).split("\n").compact uris.collect{|uri| self.new(uri, subjectid)} end -- cgit v1.2.3