public function checkPermission()
  {
    // Check current action
    switch ($this->Input->get('act'))
    {
      case 'delete':
        if (!$this->isCategoryDeletable($this->Input->get('id')))
        {
          $this->log('Deleting the non empty category with ID "'.$this->Input->get('id').'" is not allowed.', 'tl_dms_categories checkPermission', TL_ERROR);
          $this->redirect('contao/main.php?act=error');
        }
        break;
    }
  }