X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2FUpdate.py;h=31b17e99a59371e475aa22ec1c51badcf60bf742;hb=57b6a99255d4a88be9c0f910f8524677e34ff4bc;hp=3b8b55a2766ac2d05396a515cf708732b097a943;hpb=dd5639977dced0858cfa209dfc0bd129f1de0d83;p=sfa.git diff --git a/sfa/methods/Update.py b/sfa/methods/Update.py index 3b8b55a2..31b17e99 100644 --- a/sfa/methods/Update.py +++ b/sfa/methods/Update.py @@ -1,11 +1,5 @@ -### $Id: update.py 16477 2010-01-05 16:31:37Z thierry $ -### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfa/methods/update.py $ - -import time -from sfa.util.faults import * from sfa.util.method import Method -from sfa.util.parameter import Parameter, Mixed -from sfa.util.debug import log +from sfa.util.parameter import Parameter from sfa.trust.credential import Credential class Update(Method): @@ -32,8 +26,14 @@ class Update(Method): def call(self, record_dict, creds): # validate the cred valid_creds = self.api.auth.checkCredentials(creds, "update") + + # verify permissions + hrn = record_dict.get('hrn', '') + self.api.auth.verify_object_permission(hrn) + + # log origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn() - self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, None, 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)) manager = self.api.get_interface_manager()