X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FUpdatePersonTag.py;fp=PLC%2FMethods%2FUpdatePersonTag.py;h=804d17de3b5eea5cbc1421310ca5823b67f7e064;hb=ca4a8b9b86186639668abd05ebd4ef6e3ba8eebf;hp=e07f873c205283ae43d423c2feffe7d07721292d;hpb=de29d2f993c9766712510ace97d5e7519a8521f0;p=plcapi.git diff --git a/PLC/Methods/UpdatePersonTag.py b/PLC/Methods/UpdatePersonTag.py index e07f873..804d17d 100644 --- a/PLC/Methods/UpdatePersonTag.py +++ b/PLC/Methods/UpdatePersonTag.py @@ -53,10 +53,10 @@ class UpdatePersonTag(Method): # check permission : it not admin, is the user affiliated with the right person if 'admin' not in self.caller['roles']: # check caller is affiliated with this person's person - if len(set(person['person_ids']) & set(self.caller['person_ids'])) == 0: + if not self.caller.can_update(person): raise PLCPermissionDenied, "Not a member of the person's persons: %s"%person['person_ids'] - required_min_role = tag_type ['min_role_id'] + required_min_role = person_tag['min_role_id'] if required_min_role is not None and \ min(self.caller['role_ids']) > required_min_role: raise PLCPermissionDenied, "Not allowed to modify the specified person setting, requires role %d",required_min_role