Allow user role to set attributes via the SFA
[sfa.git] / sfa / plc / network.py
index 4293301..b157f13 100644 (file)
@@ -1,7 +1,8 @@
 from __future__ import with_statement
 import re
 import socket
-from sfa.util.namespace import get_authority, hrn_to_pl_slicename
+from sfa.util.xrn import get_authority
+from sfa.util.plxrn import hrn_to_pl_slicename
 from sfa.util.faults import *
 from xmlbuilder import XMLBuilder
 from lxml import etree
@@ -160,7 +161,7 @@ class Slice:
         return n
 
     # Add a new slice tag   
-    def add_tag(self, tagname, value, node = None, role_id = 40):
+    def add_tag(self, tagname, value, node = None, role_id = 30):
         tt = self.network.lookupTagType(tagname)
         if not tt.permit_update(role_id):
             raise InvalidRSpec("permission denied to modify '%s' tag" % tagname)
@@ -171,7 +172,7 @@ class Slice:
         return tag
     
     # Update a slice tag if it exists, else add it             
-    def update_tag(self, tagname, value, node = None, role_id = 40):
+    def update_tag(self, tagname, value, node = None, role_id = 30):
         tag = self.get_tag(tagname, node)
         if tag:
             if not tag.permit_update(role_id, value):
@@ -181,7 +182,7 @@ class Slice:
             tag = self.add_tag(tagname, value, node, role_id)
         return tag
             
-    def update_multi_tag(self, tagname, value, node = None, role_id = 40):
+    def update_multi_tag(self, tagname, value, node = None, role_id = 30):
         tags = self.get_multi_tag(tagname, node)
         for tag in tags:
             if tag and tag.value == value:
@@ -499,7 +500,7 @@ class Network:
         Write any slice tags that have been added or modified back to the DB
         """
         for tag in self.getSliceTags():
-            if tag.category == 'slice/rspec' and not tag.was_updated() and tag.permit_update(None, 40):
+            if tag.category == 'slice/rspec' and not tag.was_updated() and tag.permit_update(None, 30):
                 # The user wants to delete this tag
                 tag.delete()