The onBeforeDelete handler is used for when an editor tries to delete a piece of content, but before LiveWhale deletes it, you can perform your own custom validation.

To add a validation check, you can look the item up by $id and/or add error messages to the $_LW->REGISTERED_MESSAGES['failure'] array as needed.

       'title'=>'My App',

    class LiveWhaleApplicationMyApp {

      public function onBeforeDelete($data_type, $id) {
      global $_LW;
      if ($data_type=='events') { 
          $data = $_LW->read($data_type, $id);
          if ($data['gid']=2 && !$_LW->userSetting('core_admin')) {
            $_LW->REGISTERED_MESSAGES['failure'][]='Only admins are permitted to delete events from this group.';