hooks/security.py
changeset 10114 6f4b4567b77d
parent 9984 793377697c81
child 10156 57b68193413c
equal deleted inserted replaced
10113:e1e8df594d58 10114:6f4b4567b77d
   114 
   114 
   115     def __call__(self):
   115     def __call__(self):
   116         # save back editedattrs in case the entity is reedited later in the
   116         # save back editedattrs in case the entity is reedited later in the
   117         # same transaction, which will lead to cw_edited being
   117         # same transaction, which will lead to cw_edited being
   118         # overwritten
   118         # overwritten
       
   119         action = 'add' if self._cw.added_in_transaction(self.entity.eid) else 'update'
   119         CheckEntityPermissionOp.get_instance(self._cw).add_data(
   120         CheckEntityPermissionOp.get_instance(self._cw).add_data(
   120             (self.entity.eid, 'update', self.entity.cw_edited) )
   121             (self.entity.eid, action, self.entity.cw_edited) )
   121 
   122 
   122 
   123 
   123 class BeforeDelEntitySecurityHook(SecurityHook):
   124 class BeforeDelEntitySecurityHook(SecurityHook):
   124     __regid__ = 'securitybeforedelentity'
   125     __regid__ = 'securitybeforedelentity'
   125     events = ('before_delete_entity',)
   126     events = ('before_delete_entity',)