<?php

namespace Hura8\Components\Staff\Model;

class StaffDepartmentPermissionModel
{
    protected  $objStaffDepartmentModel;

    public function __construct()
    {
        $this->objStaffDepartmentModel = new StaffDepartmentModel();
    }


    public function getDepartmentMenuPermission($department_id) {
        $_info = $this->objStaffDepartmentModel->getInfo($department_id);

        return ($_info['menu_permission']) ? \json_decode($_info['menu_permission'], true) : [];
    }



    public function getDepartmentEntityPermission($department_id) {
        $_info = $this->objStaffDepartmentModel->getInfo($department_id);

        return ($_info['entity_permission']) ? \json_decode($_info['entity_permission'], true) : [];
    }

}
