From 796614bf4431d3560d6aae69de4793bdfa5a7b51 Mon Sep 17 00:00:00 2001 From: mr Date: Thu, 21 Apr 2011 13:27:53 +0200 Subject: subjectids for load_metadata in algorithm.rb and list_policies_uris changes in A&A --- lib/authorization.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lib/authorization.rb') diff --git a/lib/authorization.rb b/lib/authorization.rb index eab20df..d9f900b 100644 --- a/lib/authorization.rb +++ b/lib/authorization.rb @@ -137,16 +137,23 @@ module OpenTox # Lists policies alongside with affected uris # @param [String] subjectid # @return [Hash] keys: all policies of the subjectid owner, values: uris affected by those policies - def self.list_policy_uris( subjectid ) + def self.list_policies_uris( subjectid ) names = list_policies(subjectid) policies = {} names.each do |n| - p = OpenTox::Policies.new - p.load_xml( list_policy(n, subjectid) ) - policies[n] = p.uris + policies[n] = list_policy_uris( n, subjectid ) end policies end + + # Lists policies alongside with affected uris + # @param [String] subjectid + # @return [Hash] keys: all policies of the subjectid owner, values: uris affected by those policies + def self.list_policy_uris( policy, subjectid ) + p = OpenTox::Policies.new + p.load_xml( list_policy(policy, subjectid) ) + p.uris + end #Returns the owner (who created the first policy) of an URI # @param [String, String]uri,subjectid -- cgit v1.2.3