bugfix - nodes could not write anu tag
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 31 Jan 2011 10:51:40 +0000 (11:51 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 31 Jan 2011 10:51:40 +0000 (11:51 +0100)
PLC/AuthorizeHelpers.py

index 2f216f6..5e9c57c 100644 (file)
@@ -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