again getting away with caller_cred and passing just the hrn of the initial caller
[sfa.git] / sfa / methods / remove.py
index fb8f820..3d7d5d3 100644 (file)
@@ -35,12 +35,12 @@ class remove(Method):
 
     returns = Parameter(int, "1 if successful")
     
-    def call(self, cred, type, hrn, request_hash=None, caller_cred=None):
+    def call(self, cred, type, hrn, request_hash=None, origin_hrn=None):
 
-        if caller_cred==None:
-            caller_cred=cred
+        if origin_hrn==None:
+            origin_hrn=Credential(string=cred).get_gid_caller().get_hrn()
         #log the call
-        self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, Credential(string=caller_cred).get_gid_caller().get_hrn(), hrn, self.name))
+        self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, hrn, self.name))
         # This cred will be an authority cred, not a user, so we cant use it to 
         # authenticate the caller's request_hash. Let just get the caller's gid
         # from the cred and authenticate using that
@@ -68,7 +68,8 @@ class remove(Method):
             for registry in registries:
                 if registry not in [self.api.hrn]:
                     try:
-                        result=registries[registry].remove_peer_object(credential, record)
+                       request_hash=None
+                        result=registries[registry].remove_peer_object(credential, record, request_hash, origin_hrn)
                     except:
                         pass
         if type == "user":