hooks/security.py
changeset 4190 742e3eb16f81
parent 4048 12c4f7e2bed6
child 4252 6c4f109c2b03
--- a/hooks/security.py	Tue Dec 22 19:26:59 2009 +0100
+++ b/hooks/security.py	Tue Dec 22 19:27:26 2009 +0100
@@ -100,7 +100,7 @@
             rschema = self._cw.repo.schema[self.rtype]
             rdef = rschema.rdef(self._cw.describe(self.eidfrom)[0],
                                 self._cw.describe(self.eidto)[0])
-            rdef.check_perm(session, 'add', fromeid=self.eidfrom, toeid=self.eidto)
+            rdef.check_perm(self._cw, 'add', fromeid=self.eidfrom, toeid=self.eidto)
 
 
 class AfterAddRelationSecurityHook(SecurityHook):
@@ -135,5 +135,5 @@
         rschema = self._cw.repo.schema[self.rtype]
         rdef = rschema.rdef(self._cw.describe(self.eidfrom)[0],
                             self._cw.describe(self.eidto)[0])
-        rdef.check_perm(self._cw, 'add', fromeid=self.eidfrom, toeid=self.eidto)
+        rdef.check_perm(self._cw, 'delete', fromeid=self.eidfrom, toeid=self.eidto)