X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FAddPersonKey.py;h=af701859c0ad3f84c857f629f8e2f876e4f9e51e;hb=bd0cbf4f7f2e4cf7ceda500bfa6f98c0a700018b;hp=335b4038eb266e18a4ac11cd9b242cf4a94a9f13;hpb=d39ed0538a3ad7090d8188a691849ab07733d784;p=plcapi.git diff --git a/PLC/Methods/AddPersonKey.py b/PLC/Methods/AddPersonKey.py index 335b403..af70185 100644 --- a/PLC/Methods/AddPersonKey.py +++ b/PLC/Methods/AddPersonKey.py @@ -1,12 +1,9 @@ -# $Id$ -# $URL$ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Keys import Key, Keys from PLC.Persons import Person, Persons from PLC.Auth import Auth -from PLC.SFA import SFA can_update = lambda (field, value): field in ['key_type','key'] @@ -44,7 +41,7 @@ class AddPersonKey(Method): if person['peer_id'] is not None: raise PLCInvalidArgument, "Not a local account" - # If we are not admin, make sure caller is adding a key to their account + # If we are not admin, make sure caller is adding a key to their account if 'admin' not in self.caller['roles']: if person['person_id'] != self.caller['person_id']: raise PLCPermissionDenied, "You may only modify your own keys" @@ -59,8 +56,4 @@ class AddPersonKey(Method): self.message = 'Key %d added to person %d' % \ (key['key_id'], person['person_id']) - # sync with the geni db - sfa = SFA(self.api) - sfa.update_record(person, 'person') - return key['key_id']