temporary turn off wsdl generation
[sfa.git] / sfa / methods / get_credential.py
index 1c7d271..ff5c1a2 100644 (file)
@@ -39,11 +39,13 @@ class get_credential(Method):
         self.api.auth.check(cred, 'getcredential')
         self.api.auth.verify_object_belongs_to_me(hrn)
         auth_hrn = self.api.auth.get_authority(hrn)
-        if not auth_hrn:
+
+        # Is this a root or sub authority 
+        if not auth_hrn or hrn == self.api.config.SFA_INTERFACE_HRN:
             auth_hrn = hrn
         auth_info = self.api.auth.get_auth_info(auth_hrn)
         table = self.api.auth.get_auth_table(auth_hrn)
-        records = table.resolve('*', hrn)
+        records = table.resolve(type, hrn)
         if not records:
             raise RecordNotFound(hrn)
         record = records[0]
@@ -91,10 +93,12 @@ class get_credential(Method):
         @return string representation of a credential object
         """
         self.api.auth.verify_object_belongs_to_me(hrn)
-
         auth_hrn = self.api.auth.get_authority(hrn)
-        if not auth_hrn:
+        
+        # is this a root or sub authority
+        if not auth_hrn or hrn == self.api.config.SFA_INTERFACE_HRN:
             auth_hrn = hrn
+
         auth_info = self.api.auth.get_auth_info(auth_hrn)
 
         # find a record that matches