From: Thierry Parmentelat Date: Mon, 31 Jan 2011 10:51:40 +0000 (+0100) Subject: bugfix - nodes could not write anu tag X-Git-Tag: plcapi-5.0-26~1 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=d4d95e5eadadd8f9fdba5b812f05d64d6815b29c;p=plcapi.git bugfix - nodes could not write anu tag --- diff --git a/PLC/AuthorizeHelpers.py b/PLC/AuthorizeHelpers.py index 2f216f69..5e9c57cb 100644 --- a/PLC/AuthorizeHelpers.py +++ b/PLC/AuthorizeHelpers.py @@ -49,6 +49,10 @@ class AuthorizeHelpers: try: return Nodes(api,node_id_or_hostname)[0]['node_id'] in slice['node_ids'] except:return False + @staticmethod + def node_in_slice (api, caller_node, slice): + return caller_node['node_id'] in slice['node_ids'] + @staticmethod def node_id_in_site (api, node_id_or_hostname, site): if isinstance (node_id_or_hostname,int): @@ -167,6 +171,8 @@ def caller_may_write_slice_tag (slice, api, caller, tag_type, node_id_or_hostnam granted=False elif not AuthorizeHelpers.node_in_slice (api, caller, slice): granted=False + else: + granted=True # caller is a non-admin person else: # only admins can handle slice tags on a nodegroup