comment in GetPersons
[plcapi.git] / PLC / Methods / AddNodeTag.py
index 43e075f..af593f1 100644 (file)
@@ -64,12 +64,13 @@ class AddNodeTag(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 (%s)"%(self.name,tag_type['tagname'],self.caller['email'])
         elif AuthorizeHelpers.node_belongs_to_person (self.api, node, self.caller):
             pass
         else:
-            raise PLCPermissionDenied, "%s: you must belong in the same site as subject node"%self.name
+            raise PLCPermissionDenied, "%s: caller %r must belong in the same site as subject node %s"%\
+                (self.name,self.caller,node['hostname'])
 
 
         node_tag = NodeTag(self.api)