<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
class Authorization_Plugin_Core
{
  public function onItemDeleteBefore($event)
  {
    $payload = $event->getPayload();
    if( $payload instanceof Core_Model_Item_Abstract )
    {
      $table = Engine_Api::_()->getDbtable('allow', 'authorization');
      $table->delete(array(
        'resource_type = ?' => $payload->getType(),
        'resource_id = ?' => $payload->getIdentity(),
      ));
    }
  }
}
