<?php

use app\libraries\TenantHelper;

class Console extends CI_Controller
{
    public function __construct()
    {
        if (!is_cli()) {
            throw new Exception('You are not allowed to acccess.');
        }
        parent::__construct();
    }

    public function build_kids_permission() {
        TenantHelper::setTenant('kids');
        $this->load->model('Rbac_permission_model');
        $this->Rbac_permission_model->build_permission();

        echo 'Success';
    }

    public function build_main_permission() {
        TenantHelper::setTenant('main');
        $this->load->model('Rbac_permission_model');
        $this->Rbac_permission_model->build_permission();

        echo 'Success';
    }

    public function build_shekmun_permission() {
        TenantHelper::setTenant('shekmun');
        $this->load->model('Rbac_permission_model');
        $this->Rbac_permission_model->build_permission();

        echo 'Success';
    }
}
