From e82e7a33763357ba71c2b964f32afc8fd3afb755 Mon Sep 17 00:00:00 2001 From: rautenberg Date: Fri, 26 Jul 2013 15:20:20 +0200 Subject: remove some more subjectids --- lib/authorization.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/authorization.rb b/lib/authorization.rb index 6c3d42b..b819dde 100644 --- a/lib/authorization.rb +++ b/lib/authorization.rb @@ -98,9 +98,9 @@ module OpenTox # @param [String] action request method # @param [String] subjectid # @return [Boolean, nil] returns true, false or nil (if authorization-request fails). - def self.authorize(uri, action) + def self.authorize(uri, action, subjectid=RestClientWrapper.subjectid) return true if !AA - return true if RestClientWrapper.post("#{AA}/auth/authorize",{:uri => uri, :action => action})== "boolean=true\n" + return true if RestClientWrapper.post("#{AA}/auth/authorize",{:subjectid => subjectid, :uri => uri, :action => action})== "boolean=true\n" return false end @@ -253,11 +253,11 @@ module OpenTox end #Returns the owner (user id) of a token - # @param [String]subjectid + # @param [String]subjectid optional (normally only used for testing) # @return [String]user - def self.get_user + def self.get_user subjectid=RestClientWrapper.subjectid begin - out = RestClientWrapper.post("#{AA}/opensso/identity/attributes", {:attributes_names => "uid"}) + out = RestClientWrapper.post("#{AA}/opensso/identity/attributes", {:subjectid => subjectid, :attributes_names => "uid"}) user = ""; check = false out.split("\n").each do |line| if check -- cgit v1.2.3