always invoke caller_my_access_tag
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Sun, 28 Nov 2010 16:29:07 +0000 (17:29 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Sun, 28 Nov 2010 16:29:07 +0000 (17:29 +0100)
PLC/Accessors/Factory.py

index a207513..b1ef299 100644 (file)
@@ -181,8 +181,9 @@ def define_accessors (module, objclass, methodsuffix, tagname,
         tag_type_id = tag_type['tag_type_id']
 
         # check authorization
-        if hasattr(objclass,'caller_may_write_tag'):
-            obj.caller_may_write_tag (self.api,self.caller,tag_type)
+        if not hasattr(objclass,'caller_may_write_tag'):
+            raise PLCAuthenticationFailure, "class %s misses method caller_may_write_tag"%objclass.__name__
+        obj.caller_may_write_tag (self.api,self.caller,tag_type)
 
         # locate the join object (e.g. NodeTag or similar)
         filter = {'tag_type_id':tag_type_id}