<?php


namespace CMSMSExt\ModuleFunctions;

use CmsException;
use Exception;

class InstallAssistant
{
  protected string $_module_name = '';
  
  protected function _mod()
  {
    return \ModuleOperations::get_instance()->get_module_instance($this->_module_name);
  }
  
  public function __construct(\CMSModule $module)
  {
    $this->_module_name = $module->GetName();
  }
  
  public function Install()
  {
    $this->_mod()->CreatePermission('admin_' . $this->_module_name, 'Administer' . $this->_module_name);
  }
  
  public function Upgrade()
  {
    //$this->_mod()
  }
  
  public function Unistall()
  {
    $this->_mod()->RemovePermission('admin_' . $this->_module_name);
  }
}

?>