modify list to take an hrn argument
authorScott Baker <bakers@cs.arizona.edu>
Wed, 7 Jan 2009 02:29:08 +0000 (02:29 +0000)
committerScott Baker <bakers@cs.arizona.edu>
Wed, 7 Jan 2009 02:29:08 +0000 (02:29 +0000)
plc/registry.py
util/geniclient.py

index 1ed688e..b722c35 100644 (file)
@@ -546,11 +546,13 @@ class Registry(GeniServer):
     # @param cred credential string specifying rights of the caller
     #
     # @return list of record dictionaries
-    def list(self, cred):
+    def list(self, cred, auth_hrn):
         self.decode_authentication(cred, "list")
 
-        auth_name = self.object_gid.get_hrn()
-        table = self.get_auth_table(auth_name)
+        if not self.hierarchy.auth_exists(auth_hrn):
+            raise MissingAuthority(auth_hrn)
+
+        table = self.get_auth_table(auth_hrn)
 
         records = table.list()
 
index 29f832b..f3013df 100644 (file)
@@ -165,8 +165,8 @@ class GeniClient():
     #
     # @return list of record objects
 
-    def list(self, cred):
-        result_dict_list = self.server.list(cred.save_to_string(save_parents=True))
+    def list(self, cred, auth_hrn):
+        result_dict_list = self.server.list(cred.save_to_string(save_parents=True), auth_hrn)
         result_rec_list = []
         for dict in result_dict_list:
              result_rec_list.append(GeniRecord(dict=dict))