cosmetic changes in sendmail.py - please the linter
[plcapi.git] / PLC / Methods / UpdateIlink.py
index 05daf17..9d0d5ea 100644 (file)
@@ -38,7 +38,7 @@ class UpdateIlink(Method):
     def call(self, auth, ilink_id, value):
         ilinks = Ilinks(self.api, [ilink_id])
         if not ilinks:
-            raise PLCInvalidArgument, "No such ilink %r"%ilink_id
+            raise PLCInvalidArgument("No such ilink %r"%ilink_id)
         ilink = ilinks[0]
 
         src_if=Interfaces(self.api,ilink['src_interface_id'])[0]
@@ -49,14 +49,14 @@ class UpdateIlink(Method):
         # check authorizations
         if 'admin' in self.caller['roles']:
             pass
-        elif not AuthorizeHelpers.person_access_tag_type (self.api, self.caller, tag_type):
-            raise PLCPermissionDenied, "%s, no permission to use this tag type"%self.name
+        elif not AuthorizeHelpers.caller_may_access_tag_type (self.api, self.caller, tag_type):
+            raise PLCPermissionDenied("%s, forbidden tag %s"%(self.name,tag_type['tagname']))
         elif AuthorizeHelpers.interface_belongs_to_person (self.api, src_if, self.caller):
             pass
         elif src_if_id != dst_if_id and AuthorizeHelpers.interface_belongs_to_person (self.api, dst_if, self.caller):
             pass
         else:
-            raise PLCPermissionDenied, "%s: you must own either the src or dst interface"%self.name
+            raise PLCPermissionDenied("%s: you must own either the src or dst interface"%self.name)
             
         ilink['value'] = value
         ilink.sync()