permit updates for >= role ids
[plcapi.git] / PLC / Methods / UpdateSliceTag.py
index b62dede..932d638 100644 (file)
@@ -1,8 +1,10 @@
 # $Id$
+# $URL$
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
 from PLC.SliceTags import SliceTag, SliceTags
+from PLC.Nodes import Node
 from PLC.Slices import Slice, Slices
 from PLC.InitScripts import InitScript, InitScripts
 from PLC.Auth import Auth
@@ -24,7 +26,8 @@ class UpdateSliceTag(Method):
     accepts = [
         Auth(),
         SliceTag.fields['slice_tag_id'],
-       SliceTag.fields['value'],
+       Mixed(SliceTag.fields['value'],
+              InitScript.fields['name'])
         ]
 
     returns = Parameter(int, '1 if successful')
@@ -57,7 +60,7 @@ class UpdateSliceTag(Method):
         else:
             ### make node's min_role_id == PI min_role_id
             node_role_id = 20
-            if tag_type['min_role_id'] is not None and node_role_id > tag_type['min_role_id']:
+            if slice_tag['min_role_id'] is not None and node_role_id >= slice_tag['min_role_id']:
                 raise PLCPermissionDenied, "Not allowed to update the specified slice attribute"
        
        if slice_tag['tagname'] in ['initscript']: