- self.api.auth.check(cred, "remove")
- self.api.auth.verify_object_permission(hrn)
-
- # send the call to the right manager
- manager_base = 'sfa.managers'
- mgr_type = self.api.config.SFA_REGISTRY_TYPE
- manager_module = manager_base + ".registry_manager_%s" % mgr_type
- manager = __import__(manager_module, fromlist=[manager_base])
- return manager.remove(self.api, xrn, type, origin_hrn)
+ valid_creds = self.api.auth.checkCredentials(creds, "remove")
+ self.api.auth.verify_object_permission(xrn.get_hrn())
+
+ # log the call
+ origin_hrn = Credential(
+ string=valid_creds[0]).get_gid_caller().get_hrn()
+ self.api.logger.info("interface: %s\tmethod-name: %s\tcaller-hrn: %s\ttarget-urn: %s" % (
+ self.api.interface, self.name, origin_hrn, xrn.get_urn()))
+
+ return self.api.manager.Remove(self.api, xrn)